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

Headers not respecting ModPagespeedDisallow for page scripts #1905

Open
rafaelpatro opened this issue Jul 4, 2019 · 4 comments
Open

Headers not respecting ModPagespeedDisallow for page scripts #1905

rafaelpatro opened this issue Jul 4, 2019 · 4 comments

Comments

@rafaelpatro
Copy link

Hi guys
I'm trying to disable mod_pagespeed for some pages and it works. Nothing optimized when applying ModPagespeedDisallow.

But pagespeed headers keep affecting JS files.

ModPagespeedDisallow "*/checkout/*"
ModPagespeedRewriteLevel OptimizeForBandwidth
ModPagespeedDisableRewriteOnNoTransform off
ModPagespeedEnableFilters inline_css,move_css_to_head,inline_preview_images,lazyload_images,defer_javascript,canonicalize_javascript_libraries,insert_dns_prefetch,extend_cache,combine_javascript,convert_meta_tags,inline_google_font_css

Header always set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" #not working

So I'm trying to set cache-control directive for JS files and has no effect.
But when I disable pagespeed completely my cache-control headers works.

ModPagespeedDisallow "*/checkout/*"
ModPagespeedRewriteLevel OptimizeForBandwidth
ModPagespeedDisableRewriteOnNoTransform off
ModPagespeedEnableFilters inline_css,move_css_to_head,inline_preview_images,lazyload_images,defer_javascript,canonicalize_javascript_libraries,insert_dns_prefetch,extend_cache,combine_javascript,convert_meta_tags,inline_google_font_css
ModPagespeed Off

Header always set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" #working
@oschaaf
Copy link
Member

oschaaf commented Jul 4, 2019

Could you try https://www.modpagespeed.com/doc/configuration#add-resource-header ?
(Not 100% sure that works for non-.pagespeed. resources, but it might)

@rafaelpatro
Copy link
Author

Thanks @oschaaf
But did not work.

ModPagespeedAddResourceHeader "Cache-Control" "max-age=0, no-cache, no-store, must-revalidate"
ModPagespeedAddResourceHeader "Expires" "Wed, 12 Jan 1980 05:00:00 GMT"
AH00526: Syntax error on line...
Rejecting header 'Cache-Control '
Rejecting header 'Expires '

@Lofesa
Copy link
Contributor

Lofesa commented Jul 5, 2019

Hi @rafaelpatro
Maybe the headers are changed by the IPRO that is enabled by default in latest versions of pagespeed.
Can you try to disable it?
ModPagespeedInPlaceResourceOptimization off
This disables the optimization of resources that are not in the html, like images loaded by a javascript snippet.

@Debaucus
Copy link

Debaucus commented Feb 3, 2020

A similar issue.

I am unable to get ModPagespeedDisallow to work for .mp4 files. IPRO applies a s-maxage=10 to unoptimised resources, we pre-optimise .mp4 so just wish to deliever the content. Disabling pagespeed for a directory or just mp4 does not seem to ignore.

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

No branches or pull requests

4 participants