Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

space between filter names in server header PageSpeedFilters forces server header PageSpeed: off to be ignored #979

GoogleCodeExporter opened this issue Apr 6, 2015 · 3 comments


Copy link

What steps will reproduce the problem?
1.  with php code at :

header("PageSpeed: off");
header("PageSpeedFilters: -defer_javascript, -remove_comments");
echo "hello world\n";


2. curl -v ""

What is the expected output? What do you see instead?

Expected pagespeed to be disabled for this request, and X-Mod-Pagespeed header 
should not be included in the resultant headers

the actual output is:

* Hostname was NOT found in DNS cache
*   Trying
* Connected to ( port 8081 (#0)
> GET /blank/test.php HTTP/1.1
> User-Agent: curl/7.35.0
> Host:
> Accept: */*
< HTTP/1.1 200 OK
< Date: Tue, 02 Sep 2014 22:14:11 GMT
* Server Apache/2.4.7 (Ubuntu) is not blacklisted
< Server: Apache/2.4.7 (Ubuntu)
< X-Powered-By: PHP/5.5.9-1ubuntu4.3
< PageSpeed: off
< PageSpeedFilters: -defer_javascript, -remove_comments
< Vary: Accept-Encoding
< X-Mod-Pagespeed:
< Cache-Control: max-age=0, no-cache
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: text/html
hello world

What version of the product are you using (please check X-Mod-Pagespeed

On what operating system?

Ubuntu 14.04.1 LTS

Which version of Apache?


Which MPM?


URL of broken page:

Original issue reported on by on 2 Sep 2014 at 10:19

Copy link

Hi -- seems reasonable to strip the whitespace before processing, so this is a 
valid bug report.

However, I just want to make sure you are aware that you can solve the problem 
by removing the excess spaces.

Original comment by on 3 Sep 2014 at 2:29

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

Copy link

Ya, working around it internally. Removing spaces, or removing the 
PageSpeedFilters altogether when PageSpeed: off is set. Go's default behavior 
for handling multiple values for the same http header is to join with comma and 
spaces, causing headaches to handle the special case. 

Original comment by on 3 Sep 2014 at 2:50

Copy link

This issue was closed by revision r4339.

Original comment by on 6 Nov 2014 at 3:12

  • Changed state: Fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

1 participant