Report this

What is the reason for this report?

Pagespeed not running for PHP

Posted on September 29, 2016

Just setup a new server and have installed mod_pagespeed.

It only seems to be working on html pages, not PHP. Below are the headers for two simple pages and apart from the Vary: Accept-Encoding I can’t see any differences. Can anyone help me to get this working?

Below is a php page where you can see pagespeed is not working

HTTP/1.1 200 OK Date: Thu, 29 Sep 2016 09:20:35 GMT Content-Type: text/html;charset=UTF-8 Connection: keep-alive Set-Cookie: __cfduid=d160aaa9e45a863e3a570263393bd44d41475140835; expires=Fri, 29-Sep-17 09:20:35 GMT; path=/; domain=.thinkoptimised.com; HttpOnly Set-Cookie: grav-site-40d1b2d=eo47rrkp2bv5vo91fn8gjjqbs0; expires=Thu, 29-Sep-2016 09:50:35 GMT; Max-Age=1800; path=/; domain=www.thinkoptimised.com Expires: Thu, 06 Oct 2016 09:20:35 GMT Cache-Control: max-age=604800 Pragma: no-cache Set-Cookie: grav-site-40d1b2d=eo47rrkp2bv5vo91fn8gjjqbs0; expires=Thu, 29-Sep-2016 09:50:35 GMT; Max-Age=1800; path=/; domain=www.thinkoptimised.com; HttpOnly Content-Encoding: none Server: cloudflare-nginx CF-RAY: 2e9e5c2f16de1359-LHR

Below is the html page where you can see pagespeed is working

HTTP/1.1 200 OK Date: Thu, 29 Sep 2016 09:21:20 GMT Content-Type: text/html; charset=utf-8 Connection: keep-alive Set-Cookie: __cfduid=dac868428de03c5593734cc0f9972f9421475140880; expires=Fri, 29-Sep-17 09:21:20 GMT; path=/; domain=.thinkoptimised.com; HttpOnly Vary: Accept-Encoding X-Mod-Pagespeed: 1.11.33.2-0 Cache-Control: max-age=0, no-cache Server: cloudflare-nginx CF-RAY: 2e9e5d4626f40a66-LHR



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Are you seeing anything different if you access your service directly? According to the headers you’ve provided this content is being proxied via CloudFlare and these headers are coming from their service sitting in the middle

So after trying everything I can think of I think it is the Grav CMS I am using which is injecting the header.

I have yet to find out how to stop this though

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.