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

DispatcherMaxAgeHeaderFilter.

Avatar

Avatar
Ignite 1
Level 1
vegardengen
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back 3
Give Back
View profile

Avatar
Ignite 1
Level 1
vegardengen
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back 3
Give Back
View profile
vegardengen
Level 1

11-10-2019

I am trying to add cache-control headers on publish, following this guide:

Dispatcher TTL

I have added a few configuration, and can see that the filter triggers - but the header is not on the response from publish.

I have tried this directly to publish, remembering to add the Server-Agent header.

Debug logs for com.adobe.acs states that the header is added, but the response does not contain this header.

I am using AEM 6.5 and have ACS version 4.3.2

Replies

Avatar

Avatar
Coach
Employee
jbrar
Employee

Likes

387 likes

Total Posts

869 posts

Correct Reply

283 solutions
Top badges earned
Coach
Establish
Give Back 50
Give Back 5
Give Back 3
View profile

Avatar
Coach
Employee
jbrar
Employee

Likes

387 likes

Total Posts

869 posts

Correct Reply

283 solutions
Top badges earned
Coach
Establish
Give Back 50
Give Back 5
Give Back 3
View profile
jbrar
Employee

11-10-2019

Can you check the following:

- Dispatcher version is >4.1.1

- /enableTTL "1" is set on dispatcher

- Allow this header in the dispatcher.any file

Avatar

Avatar
Ignite 1
Level 1
vegardengen
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back 3
Give Back
View profile

Avatar
Ignite 1
Level 1
vegardengen
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back 3
Give Back
View profile
vegardengen
Level 1

11-10-2019

[Wed Oct 09 14:10:11 2019] [I] [pid 1282 (tid 139690814244992)] Dispatcher initialized (build 4.3.2/apache2.4-linux-x86_64)

We have several dispatcher farms, so this is my dispatcher.any:

/farms {

        $include "enabled_farms/*_farm.any"

}


The relevant dispatcher farm, however, have enableTTL 1.

I have debugged this directly towards my publish instance too, like this:

curl -k -v --header "Server-Agent: Communique-Dispatcher" http://localhost:4503/content/dam/barn-dnb-no/page-images/article-pages/illustration_barnehagefradra...

This is my response headers:

< Content-Disposition: attachment; filename="illustration_barnehagefradrag.svg"

< Last-Modified: Thu, 10 Oct 2019 12:14:37 GMT

< Content-Type: image/svg+xml

< Content-Length: 15904


This is the content of my acs.log from this request.

11.10.2019 16:02:22.419 *DEBUG* [qtp849642209-2206] com.adobe.acs.commons.http.headers.impl.AbstractDispatcherCacheHeaderFilter Adding header Cache-Control: max-age=7200

Which corresponds to what is set here:

cat /opt/aem/publish/crx-quickstart/launchpad/config/com/adobe/acs/commons/http/headers/impl/DispatcherMaxAgeHeaderFilter%007ebarn-articleImages.config

:org.apache.felix.configadmin.revision:=L"2"

filter.pattern=[ \

  "/content/dam/barn-dnb-no/page-images/article-pages/(.*)", \

  ]

max.age="7200"

service.factoryPid="com.adobe.acs.commons.http.headers.impl.DispatcherMaxAgeHeaderFilter"

service.pid="com.adobe.acs.commons.http.headers.impl.DispatcherMaxAgeHeaderFilter~barn-articleImages"

Avatar

Avatar
Give Back 5
Level 4
Bharath_valse
Level 4

Likes

34 likes

Total Posts

65 posts

Correct Reply

11 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile

Avatar
Give Back 5
Level 4
Bharath_valse
Level 4

Likes

34 likes

Total Posts

65 posts

Correct Reply

11 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile
Bharath_valse
Level 4

11-10-2019

Please check if the path in question(/content/dam/barn-dnb-no/page-images/article-pages/illustration_barne hagefradrag.svg) is cached on the dispatcher. if not try to cache the files for TTL to work.

Avatar

Avatar
Ignite 1
Level 1
vegardengen
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back 3
Give Back
View profile

Avatar
Ignite 1
Level 1
vegardengen
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back 3
Give Back
View profile
vegardengen
Level 1

11-10-2019

It is getting cached in dispatcher, and I have also deleted the cache to see that this is not the problem.

Nevertheless, for this testing I am bypassing dispatcher, and as described above, I have verified that the relevant configured actions are triggered on publish.

Avatar

Avatar
Give Back 5
Level 4
Bharath_valse
Level 4

Likes

34 likes

Total Posts

65 posts

Correct Reply

11 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile

Avatar
Give Back 5
Level 4
Bharath_valse
Level 4

Likes

34 likes

Total Posts

65 posts

Correct Reply

11 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile
Bharath_valse
Level 4

11-10-2019

I feel this is expected because the request is for an asset directly which returns binary. Try requesting for a path(/content/dam/barn-dnb-no/page-images/article-pages) which should return the expected response headers related to cache. Post this the actual test you should be doing is if the cache is cleared on the dispatcher with the set expire time.

Avatar

Avatar
Ignite 1
Level 1
vegardengen
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back 3
Give Back
View profile

Avatar
Ignite 1
Level 1
vegardengen
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back 3
Give Back
View profile
vegardengen
Level 1

14-10-2019

It seems you are right?

So, hardcoding these in dispatcher config is the only option for static content, but for dynamic content, OSGI config is also an option, then?