Cache Control for Blogger?

799 views
Skip to first unread message

Miguel García Sánchez - Colomer

unread,
Apr 28, 2014, 4:41:35 PM4/28/14
to pagespeed-ins...@googlegroups.com
Hi, 
can i use php to write http headers with Blogger to fix the cache suggestions?... something like this:


<?php
header("Cache-Control: max-age=3600"); // HTTP/1.1
header("Expires: Sat, 29 apr 2014 05:00:00 GMT"); // Fecha en el pasado
?>

Best regards,

Dave Mankoff

unread,
May 28, 2014, 2:01:27 PM5/28/14
to pagespeed-ins...@googlegroups.com
Howdy Miguel.

Yes, in short.

Be sure that your web server isn't conflicting in any way with what you put in via PHP. That is to say, make sure that it's not stripping, changing, or duplicating headers.

Important Note: Do not put in both a Cache-Control and Expires header. They are redundant. We talk about this here: https://developers.google.com/speed/docs/insights/LeverageBrowserCaching


-dave mankoff

Miguel García Sánchez - Colomer

unread,
May 28, 2014, 3:17:25 PM5/28/14
to pagespeed-ins...@googlegroups.com
Howdy Dave, 
a pleasure talk with you.

I have tested it but Pagespeed don't detect it as i have the cache control activated... i have think that maybe this could be a good alternative to Blogger's users but i think that it's impossible to enable the cache for this case...

Dave Mankoff

unread,
May 28, 2014, 3:24:08 PM5/28/14
to pagespeed-ins...@googlegroups.com
I apologize, as I misread your question.

You can't put custom PHP into Blogger, so in that regard this will not work. Blogger is not written in and does not run PHP.

In the general case, where one is is running their own webserver with PHP, you would be able to set headers through this method.


-dave mankoff

Miguel García Sánchez - Colomer

unread,
May 29, 2014, 3:43:15 AM5/29/14
to pagespeed-ins...@googlegroups.com
Hi Dave!,
i understand it. Thank you very much for your help.

Best regards!.
Reply all
Reply to author
Forward
0 new messages