Grav is inserting a "Pragma : no-cache" header which breaks mod_pagespeed

I’ve asked the question on git hub https://github.com/getgrav/grav/issues/1081 but have been pointed here.

Im at a loss as to how to solve this issue. Essentially any page run through grav seem to add a “Pragma:no-cache” header which I think is stopping mod_pagespeed from working.

To show that it isn’t a server config issue you can see pagespeed is working via:

http://www.thinkoptimised.com/example.html
http://www.thinkoptimised.com/example.php

and both pages return the “X-Mod-Pagespeed : 1.11.33.2-0” header. However the homepage doesn’t http://www.thinkoptimised.com/

Both the example pages are served from the same directory as the main Grav index.php

I can see that there isn’t anything in the core code that is inserting it so I don’t know where to look next.

I also tested this out on a fresh install of Grav on a fresh LAMP Digital Ocean droplet and have the same issues.

Trying to unset the header in the htaccess doesn’t solve the issue.

Has anyone else come across this or has anyone issue or have you got Pagespeed working?

I’ve found the issue and updates the issue on github. Here is what I found

/system/src/Grav/Common/Grav.php line 133 has register_shutdown_function([$this, 'shutdown']);

If you comment out this line mod_pagespeed springs back to life. Tested locally and now on live and I can see the effects.

I understand it would be written back in after an update, but what would be the harm in removing this line permanently for my installation of Grav?

I suggest to you to post an issue in github repo getgrav/grav

chuckles He did and I suggested he check here as well to see if others used mod_pagespeed :slight_smile: