Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Cache control is not set by Apache2.4 and dispatcher when using Head request

Avatar

Avatar
Level 1
rakmvk
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
rakmvk
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile
rakmvk
Level 1

04-12-2020

 

We are migrating from Apache2.2 to Apache2.4 , seeing a strange behavior with  curl -I HEAD request ,when then content is not cached on Apache , cache control header is not set, but once the content is cached on Apache header is set . Any one have any idea why this is happening.

 

Apache: 2.4.46

dispatcher:4.3.3

 

cache control rule on Apache

Header always set Cache-Control "public, max-age=86400"

 

curl -I http://localhost/test.html

HTTP/1.1 200 OK
Date: Fri, 04 Dec 2020 20:21:17 GMT
Server: Apache
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: frame-ancestors 'self'
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Type: text/html;charset=utf-8

 

Thanks
Rakesh

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Affirm 100
MVP
shelly-goel
MVP

Likes

243 likes

Total Posts

408 posts

Correct Reply

104 solutions
Top badges earned
Affirm 100
Give Back 25
Ignite 3
Give Back 10
Validate 1
View profile

Avatar
Affirm 100
MVP
shelly-goel
MVP

Likes

243 likes

Total Posts

408 posts

Correct Reply

104 solutions
Top badges earned
Affirm 100
Give Back 25
Ignite 3
Give Back 10
Validate 1
View profile
shelly-goel
MVP

04-12-2020

Hi Rakash,

This is an expected behavior/ feature in dispatcher 4.1.11 onwards for caching HTTP response headers.

/headers property under /cache section allows to define the HTTP header types that are going to be cached by the Dispatcher. On the first request to an uncached resource, all headers matching one of the configured values (see the configuration sample below) are stored in a separate file, next to the cache file. On subsequent requests to the cached resource, the stored headers are added to the response.

/cache {
  ...
  /headers {
    "Cache-Control"
    "Content-Disposition"
    "Content-Type"
    "Expires"
    "Last-Modified"
    "X-Content-Type-Options"
    "Last-Modified"
  }
}

Reference: https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/dispatcher-c...

Hope this helps.