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

Dispatcher | Last-Modified attribute missing in response header

Avatar

Level 4

Hi all,

 

Need your expert comments. We are using CQ 5.6.1

 

We have a requirement to capture "Last-Modified" attribute in "Response Header" for DAM assets like PDF. We are able to see "Last-Modified" attribute in response header on Author & Publish for DAM assets. But "Last-Modified" attribute is missing when we try to access the same asset from Dispatcher. Is there any extra disptacher configuration that we need to make this work. Other response header atribute are appearing on dispatcher without any issue. For your reference below are the request attribute which we can see on dispatcher.

 

 

 

I tried looking at Adobe post and found this link but its applicable to CQ 5.3 (I can see Last-Modified header coming even without installing this package on Author & Pub)

CQ5.3: Missing HTML Content Headers

 

Copy pasting for your quick reference:

Symptoms

Certain HTML content headers (i.e. Content-TypeContent-LengthLast-Modified, etc...) are missing when requesting file from DAM.

Resolution

The package BinaryProviderServletOverlay.zip contains the fix that overlay theGET.java code.
 

  1. Install the package using CQ package manager.
  2. Open http://<host>:<port>/system/console/configMgr.
  3. Select Apache Sling Servlet/Script Resolver and Error Handler config entry.
  4. Set Servlet Registration Root Path to 1 and save.

Applies to

CQ 5.3

 

Below is the sample request/response header which we are getting on hitting PDF from dispatcher:

 


  1. Request Method:GET
  2. Status Code:200 OK
  3. Request Headersview source
    1. Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
    2. Accept-Encoding:gzip,deflate,sdch
    3. Accept-Language:en-US,en;q=0.8
    4. Cache-Control:max-age=0
    5. Connection:keep-alive
    6. Cookie:channel-cookie=consumer; location-pref=US; renderid=rend01; JSESSIONID=DB29D475BEB60C4A305C30D805CE549C; active-tab-index=consumer%3D0; __atuvc=1%7C11; _ga=GA1.2.837807738.1394306276
    7. Host:wwwuat.resmed.com
    8. User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36
  4. Response Headersview source
    1. Accept-Ranges:bytes
    2. Cache-Control:max-age=0, no-cache, no-store
    3. Connection:Transfer-Encoding
    4. Connection:keep-alive
    5. Content-Encoding:gzip
    6. Content-Type:application/pdf
    7. Date:Sun, 09 Mar 2014 09:47:51 GMT
    8. Expires:Sun, 09 Mar 2014 09:47:51 GMT
    9. Pragma:no-cache
    10. Server:Apache
    11. Transfer-Encoding:chunked
    12. Vary:Accept-Encoding
    13. X-Akamai-Staging:ESSL
    14. X-Frame-Options:SAMEORIGIN, SAMEORIGIN
    15. X-XSS-Protection:1; mode=block

 

Please let me know if any of you have encountered same issue.

 

Thanks in advance.

 

Regards,

Rohit

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

The dispatcher acts independently from CQ; if you deliver cached items from the disptacher cache, the HTTP headers in the response are solely created by the webserver, and the dispatcher isn't really involved in that delivery at all. So you need to configure your webserver to create the correct headers for you. IIRC Apache does it by default. I see from your headers that you include Akamai in your setup. I don't know Akamai that well, but maybe this header gets removed by Akamai?

Jörg

View solution in original post

4 Replies

Avatar

Correct answer by
Employee Advisor

The dispatcher acts independently from CQ; if you deliver cached items from the disptacher cache, the HTTP headers in the response are solely created by the webserver, and the dispatcher isn't really involved in that delivery at all. So you need to configure your webserver to create the correct headers for you. IIRC Apache does it by default. I see from your headers that you include Akamai in your setup. I don't know Akamai that well, but maybe this header gets removed by Akamai?

Jörg

Avatar

Level 4

Hi Jorg,

Thanks for your reply.

When we update the config in Apache then now "Last-Modified" header is appearing. But now how do we need set the "Modification Timestamp" of the asset to this header .

 

Below is the reference to the change which we did in Apache:

<FilesMatch "\.(pdf)$">
Header set Last-Modified
</FilesMatch>

Avatar

Level 2

Just a quick addendum for those who are searching for this. Since Dispatcher 4.1.11, response headers can now be cached by the dispatcher and served when requesting cached items. See https://docs.adobe.com/content/help/en/experience-manager-dispatcher/using/configuring/dispatcher-co... for more information.