How to make ModPagespeed send a "Cache-Control: no-transform" header while still doing its work

閲覧: 78 回
最初の未読メッセージにスキップ

David Scherfgen

未読、
2015/08/30 10:51:532015/08/30
To: mod-pagespeed-discuss
Hi,

I want ModPagespeed to send a Cache-Control: no-transform header in addition to the normal values it sends (Cache-Control: max-age=0, no-cache). So, what I want is the following header to be sent:

Cache-Control: max-age=0, no-cache, no-transform

Is there any way to achieve this?

I tried the following in PHP:

header("Cache-Control: max-age=0, no-cache, no-transform");

But then ModPagespeed will honor the no-transform setting by not optimizing the HTML.

What I want is optimized HTML code, but sending no-transform "downstream".

In case anyone wonders why I want this: There are some services like "Google Web Light" that try to provide minified versions of websites for users with low bandwidth. However, it fails on my sites and makes them unusable, because they depend on JavaScript. The way to tell Google Web Light, and possibly other such services, not to do this for a particular website, is to send the Cache-Control: no-transform header.

Thanks for any suggestions!

Best regards,
David

Joshua Marantz

未読、
2015/08/30 12:43:402015/08/30
To: mod-pagespeed-discuss
Your request is a good one, and I've added it as https://github.com/pagespeed/mod_pagespeed/issues/1129 .  
In the meantime, I have something else for you to try: can you try to add the no-transform header in an apache conf file directive:
  Header add cache-control no-transform
I think mod_pagespeed might not see that because it runs upstream of mod_headers.

Similarly, you could add no-transform at a reverse-proxy, after mod_pagespeed has already run.

-Josh

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/b4589f29-4f2e-4b20-995b-a3f5b4a9d277%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Scherfgen

未読、
2015/08/30 14:59:202015/08/30
To: mod-pagespeed-discuss
Thanks a lot! The "Headers" directive did the trick (although I replaced "add" by "merge").
全員に返信
投稿者に返信
転送
新着メール 0 件