Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control Mod_Pagespeed using environment variables #201

Closed
GoogleCodeExporter opened this issue Apr 6, 2015 · 4 comments
Closed

Control Mod_Pagespeed using environment variables #201

GoogleCodeExporter opened this issue Apr 6, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

@GoogleCodeExporter GoogleCodeExporter commented Apr 6, 2015

Request:

A mechanism for disabling Mod_Pagespeed for specific requests or clients based 
on environment variables set using BrowserMatch, SetEnvIf or other directives.

Similar options already exist for mod_deflate and other modules, but this might 
be at the Apache level rather than just in the modules themselves? 
http://httpd.apache.org/docs/2.2/env.html#special

Example usage: SetEnvIfNoCase Request_URI \.js$ no-gzip dont-vary

Reason:

To be able to turn off Mod_Pagespeed for a directory that only exists due to 
mod_rewrite rules.
e.g. SetEnvIf Request_URI /edit/ no-pagespeed

Where there is no /edit/ directory on the file system:
e.g. RewriteRule ^edit/(.*.html)$ $1?display_edit_mode=true

Could also be used to disable Mod_Pagespeed for particular User-Agents or 
remote addresses.

Thanks.

Original issue reported on code.google.com by dun...@chirp.com.au on 30 Jan 2011 at 4:05

@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented Apr 6, 2015

Original comment by sligocki@google.com on 31 Jan 2011 at 4:36

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect
@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented Apr 6, 2015

Original comment by jmara...@google.com on 24 May 2012 at 7:18

  • Changed state: Accepted
@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented Apr 6, 2015

I'm a bit slow to the game on this one, but note that you can do:

<Location /edit/>
  ModPagespeed off
</Location>

Unless there are other use-cases that can't be specified using existing 
functionality, I don't think we need to support env-variables.

Original comment by sligocki@google.com on 10 Sep 2012 at 8:30

  • Changed state: WontFix
@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented Apr 6, 2015

I'm not sure that the Location directive is compatible with rewritten URLs that 
aren't actually in the directories they appear to be (i.e. when REQUEST_URI !== 
SCRIPT_FILENAME).

A more pertinent example is to recognise a specific spider and turn off some or 
all ModPagespeed filters - to make comments visible or show the true 
Last-Modified headers for example.
e.g.
  SetEnvIf User-Agent "^htdig" no-pagespeed

Original comment by dun...@chirp.com.au on 11 Sep 2012 at 7:07

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.