Hi all,
So I'm getting error:
Adv CSS/JS Agg - Cache-Control The cache-control's max-age header being sent by your web server is not at least 1 month in the future.
The web servers configuration should be adjusted only for AdvAgg files. Was looking that the max-age second counter is over 2,628,000 (1 month), actually got no-cache, must-revalidate, post-check=0, pre-check=0.
Warning
Adv CSS/JS Agg - Cache-Control The cache-control's max-age header being sent by your web server is not at least 1 month in the future.
The web servers configuration should be adjusted only for AdvAgg files. Was looking that the max-age second counter is over 2,628,000 (1 month), actually got no-cache, must-revalidate, post-check=0, pre-check=0.
Warning
Adv CSS/JS Agg - Cache-Control The cache-control's max-age header being sent by your web server is not at least 1 month in the future.
The web servers configuration should be adjusted only for AdvAgg files. Was looking that the max-age second counter is over 2,628,000 (1 month), actually got no-cache, must-revalidate, post-check=0, pre-check=0.
Warning
Adv CSS/JS Agg - Cache-Control The cache-control's max-age header being sent by your web server is not at least 1 month in the future.
The web servers configuration should be adjusted only for AdvAgg files. Was looking that the max-age second counter is over 2,628,000 (1 month), actually got no-cache, must-revalidate, post-check=0, pre-check=0.
I do see #2097033: "cache-control's max-age header" and "The expires header" but it looks like the change on .htaccess won't be applicable on Pantheon sites since they use Nginx.
Any inputs appreciated.
Thanks!
Comments
Comment #1
mikeytown2 commentedThe readme has nginx rules in it
http://cgit.drupalcode.org/advagg/tree/README.txt#n409
Comment #2
dsdeiz commentedYeah although configuration in Pantheon for nginx isn't allowed:
Comment #3
mikeytown2 commentedIs there a subdirectory on the platform that allows for "far-future" cache expiration?
Comment #4
dsdeiz commentedSorry, I'm not sure what this is but if I did a search on the docs on Pantheon, I'm not finding anything related to "far-future" or containing that phrase.
Comment #5
mikeytown2 commentedFar future headers are for browser caching: https://developer.yahoo.com/blogs/ydn/high-performance-sites-rule-3-add-...
Looking at https://pantheon.io/docs/articles/architecture/edge/varnish/debugging-ca... & https://pantheon.io/docs/articles/architecture/edge/varnish/caching-adva... it appears that pantheon turns off all browser caching if you're logged in to the site. Outside of that it does 1 week of caching for the files. So if this is the only thing that advagg is complaining about you can ignore it by putting this in your settings.php file or doing a varable_set call.
$conf['advagg_skip_404_check'] = TRUE;Comment #6
dsdeiz commented@mikeytown2, sweet thanks for checking!
I've set
advagg_skip_404_checkthough it didn't fix the issue. I did a check on that variable and it looks like it doesn't have to do anything with the report for Cache-Control. The function I checked responsible wasadvagg_install_chk_urls()and it looks like this is called whetheradvagg_skip_404_checkis enabled or disabled.I am on 7.x-2.7 btw. Not sure if that's relevant.
Comment #7
mikeytown2 commentedThinking it'll need a skip far future check setting. I can get around to doing this by the end of the month.
Comment #8
dsdeiz commentedHi,
Would it happen to be just a simple configuration that skips
advagg_install_chk_urls()? If so, I can probably try to work on it.Thanks!
Comment #9
mikeytown2 commentedJust skip the far future part of that function; So from line 1189 to 1233.
Comment #10
dsdeiz commentedI simply added the 'hidden' configuration
advagg_skip_far_future_check. Not sure if I got this right though. Patch attached.Comment #11
mikeytown2 commentedLooks pretty good. I would define the variable name in uppercase as the default value though, makes using variable_get easier to do as you don't need to remember the default value then.
Comment #12
dsdeiz commentedSorry, not sure what you mean. Can you elaborate a little? You mean
ADVAGG_SKIP_FAR_FUTURE_CHECKrather thanadvagg_skip_far_future_check?Comment #13
mikeytown2 commentedLike this: variable_get('advagg_skip_far_future_check', ADVAGG_SKIP_FAR_FUTURE_CHECK)
Comment #14
dsdeiz commentedAh cool. Thanks! Attached patch and interdiff.
Comment #15
dsdeiz commentedComment #16
mikeytown2 commentedLooks good I'll commit it next week.
Comment #17
mikeytown2 commentedAdded in some text telling the user how to turn off this check on the status report page.
Comment #20
Anonymous (not verified) commentedOne small problem with the patch that was committed:
'@skipcode' => '$conf[\'advagg_skip_far_future_check\'] = FALSE;',should be'@skipcode' => '$conf[\'advagg_skip_far_future_check\'] = TRUE;',.Here is a patch that fixes that small issue.
Comment #21
dsdeiz commentedGood catch. I guess this is a no brainer. Marking as RTBC.
Comment #22
mikeytown2 commentedThanks for the patch!
Comment #26
mikeytown2 commentedPatch already committed
Comment #28
ruplI deployed this to Pantheon recently and it was recommending that I set this configuration to both
FALSEandTRUE. Seems the last patch just missed the second occurrence of the warning, since README reports the default to beFALSE.Here's a tiny lil patch that sets both recommendations to TRUE.
Comment #29
mikeytown2 commentedThanks for catching this! Patch has been committed.