How to get pagespeed variales ?

29 views
Skip to first unread message

John Grant

unread,
Mar 27, 2017, 3:30:38 AM3/27/17
to ngx-pagespeed-discuss
Hi All,
with nginx we can get many variables to know byte_sent, upstream_bytes_received, gzip_ratio, etc...
is there a way with PageSpeed to get its internal variables, like original_size, optimized_size, is_recompressed, etc... from the PSOL in order to write them to the nginx log file ?

in the nginx log we can have the upstream file size and the sent size to user but when the file is optmized by pagespeed then we don't know the ratio (original minus optimized).
maybe i missed the right wiki page, i'm looking for this way since days now...

thanks in advance for your comments :o)

bye Ed.

Otto van der Schaaf

unread,
Mar 27, 2017, 3:58:25 AM3/27/17
to ngx-pagespeed-discuss
I think there's X-Original-Content-Length in the response headers, which combined with the actual bytes sent may help determine a ratio?

Otto

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.
Visit this group at https://groups.google.com/group/ngx-pagespeed-discuss.
For more options, visit https://groups.google.com/d/optout.

John Grant

unread,
Mar 27, 2017, 4:42:40 AM3/27/17
to ngx-pagespeed-discuss
Hi Otto,
Thanks for the trick, i now see the X-Original-Content-Length in the headers:
Content-Length: 36834
X-Original-Content-Length: 43835
Length: 36834 (36K) [image/jpeg]

last point is to put the value in the nginx log file :o)
i tried '$http_x_original_content_length' and '$sent_http_x_original_content_length' but i get a '-' or nothing, still digging...

bye Ed.
Reply all
Reply to author
Forward
0 new messages