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

mikeytown2’s picture

dsdeiz’s picture

Yeah although configuration in Pantheon for nginx isn't allowed:

nginx.conf
Pantheon does not currently support modifying the nginx.conf per site, as we run a highly tuned universal configuration file.

mikeytown2’s picture

Is there a subdirectory on the platform that allows for "far-future" cache expiration?

dsdeiz’s picture

Sorry, 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.

mikeytown2’s picture

Far 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;

dsdeiz’s picture

@mikeytown2, sweet thanks for checking!

I've set advagg_skip_404_check though 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 was advagg_install_chk_urls() and it looks like this is called whether advagg_skip_404_check is enabled or disabled.

I am on 7.x-2.7 btw. Not sure if that's relevant.

mikeytown2’s picture

Thinking it'll need a skip far future check setting. I can get around to doing this by the end of the month.

dsdeiz’s picture

Hi,

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!

mikeytown2’s picture

Just skip the far future part of that function; So from line 1189 to 1233.

dsdeiz’s picture

StatusFileSize
new5.89 KB

I simply added the 'hidden' configuration advagg_skip_far_future_check. Not sure if I got this right though. Patch attached.

mikeytown2’s picture

Looks 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.

dsdeiz’s picture

Looks 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.

Sorry, not sure what you mean. Can you elaborate a little? You mean ADVAGG_SKIP_FAR_FUTURE_CHECK rather than advagg_skip_far_future_check?

mikeytown2’s picture

Like this: variable_get('advagg_skip_far_future_check', ADVAGG_SKIP_FAR_FUTURE_CHECK)

dsdeiz’s picture

Ah cool. Thanks! Attached patch and interdiff.

dsdeiz’s picture

Status: Active » Needs review
mikeytown2’s picture

Status: Needs review » Reviewed & tested by the community

Looks good I'll commit it next week.

mikeytown2’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new6.67 KB

Added in some text telling the user how to turn off this check on the status report page.

  • mikeytown2 committed f5ce34d on 7.x-2.x authored by dsdeiz
    Issue #2471309 by dsdeiz, mikeytown2: Cache-Control and Pantheon
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Anonymous’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new1.04 KB

One 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.

dsdeiz’s picture

Status: Needs review » Reviewed & tested by the community

Good catch. I guess this is a no brainer. Marking as RTBC.

mikeytown2’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patch!

Status: Fixed » Needs work

The last submitted patch, 20: advagg-2471309-20-skip-far-future.patch, failed testing.

The last submitted patch, 17: advagg-2471309-17-skip-far-future.patch, failed testing.

mikeytown2’s picture

Status: Needs work » Fixed

Patch already committed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rupl’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs review
StatusFileSize
new315.97 KB
new1.06 KB

I deployed this to Pantheon recently and it was recommending that I set this configuration to both FALSE and TRUE. Seems the last patch just missed the second occurrence of the warning, since README reports the default to be FALSE.

AdvAgg advising that 'advagg_skip_far_future_check' be set to both TRUE and FALSE

Here's a tiny lil patch that sets both recommendations to TRUE.

mikeytown2’s picture

Status: Needs review » Fixed

Thanks for catching this! Patch has been committed.

  • mikeytown2 committed 29fbfbe on 7.x-2.x authored by rupl
    Issue #2471309 by rupl: Cache-Control and Pantheon
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.