Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

http Age header generation on dispatcher

Avatar

Community Advisor

Dear Members,

We are running thru one issue, where pages are not bing cached at the Akami(CDN) level due to the  "Age"(not the max-age directive) header being added from the origin or dispatcher.

We don't have any code or configuration for the same in our project. Do anyone have any idea, what may be causing the issue?

If anyone might have faced such a scenario please help us to identify.

Thanks

Umesh Thakur

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @Umesh_Thakur!

It's a bit hard to tell where the HTTP Age Header originates without any knowledge of your setup.

I would recommend to perform an analysis to identify the origin (first step: is it set by AEM or the dispatcher?).

 

As a short term solution, you could use mod_headers in the Apache HTTPD (dispatcher) level to remove the unwanted header from your responses:

Header always unset Age

The AEMaCS documentation on caching provides some additional details on response headers.

 

You may also want to check if your dispatcher is configured to cache HTTP response headers . In this case, you would want to invalidate the cache after performing changes.

 

Hope that helps!

View solution in original post

5 Replies

Avatar

Community Advisor

Hi @Umesh_Thakur 

 

The Age header contains the time in seconds the object has been in a proxy cache.

 

The Age header is usually close to zero. If it is Age: 0, it was probably just fetched from the origin server; otherwise It is usually calculated as a difference between the proxy's current date and the Date general header included in the HTTP response. So it should not impact the caching at all.

 

The Access-Control-Max-Age response header indicates how long the results of a preflight request (that is the information contained in the Access-Control-Allow-Methods and Access-Control-Allow-Headers headers) can be cached.

 

So if you have Max-Age header present and the value is 0 or -1 then the content will never be cached at CDN.

Anoother reason of no cache could be the cookie value, If there are any cookie which contains different value each time the same resource has been requested then CDN will always return a new copy of content than the cached copy.

 

Thanks!

Avatar

Correct answer by
Employee Advisor

Hi @Umesh_Thakur!

It's a bit hard to tell where the HTTP Age Header originates without any knowledge of your setup.

I would recommend to perform an analysis to identify the origin (first step: is it set by AEM or the dispatcher?).

 

As a short term solution, you could use mod_headers in the Apache HTTPD (dispatcher) level to remove the unwanted header from your responses:

Header always unset Age

The AEMaCS documentation on caching provides some additional details on response headers.

 

You may also want to check if your dispatcher is configured to cache HTTP response headers . In this case, you would want to invalidate the cache after performing changes.

 

Hope that helps!

Avatar

Community Advisor

thanks for the response @markus_bulla_adobe ,

As I mentioned in the question itself we don't have any thing either in the code or in configuration, which is adding the Age header in the response.

mod_headers changes are there on plate, we are looking for the impact of it, if there is any.

Your response really helps.

Thanks again

Umesh Thakur

Avatar

Level 1

I discovered that the Dispatcher configuration enableTTL "1" causes the "age" header to be returned on the response.  I was unable to over-ridde it with the Apache "Header unset" statement.  I suggest that you try removing this option if your caching strategy allows you to.