Search code examples
apachenginxmod-pagespeed

Google PageSpeed module: how to stop it to change the Cache-Control header on NGINX


I'm trying to stop Google's PageSpeed module to modify the Cache-Control header using nginx.

Within Apache I'm able to stop it with these two instructions:

ModPagespeedModifyCachingHeaders off
ModPagespeedDisableFilters extend_cache

Is there an equivalent of ModPagespeedModifyCachingHeaders on nginx?

I tried with:

pagespeed DisableFilters extend_cache;

and also

pagespeed RewriteLevel PassThrough;

In both cases it adds the header Cache-Control: "max-age:300".


Solution

  • For nginx you would need to add this to the config to force PageSpeed to leave the original caching headers:

    pagespeed ModifyCachingHeaders off;
    

    Find more here: https://developers.google.com/speed/pagespeed/module/configuration#ModifyCachingHeaders