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 cache - Backend forbids caching

Avatar

Level 1

Dispatcher is not able to cache some of the pages. We noticed that dispatcher is logging the below log whenever this happens:

"Backend forbids caching, sent: 'Cache-Control: private'"

 

Any idea what may be happening here? We are not adding any response header on AEM publish server. I checked the

org.eclipse.jetty.server.HttpChannel logs as well and 'Cache-Control' header is not part of AEM response. Also verified by hitting the publish server directly using the browser.

 

Any pointers would be appreciated !

 

----------------------------------------

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] Adding request header: Host

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] Adding request header: Accept

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] Adding request header: User-Agent

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] Adding request header: Accept-Language

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] Adding request header: Referer

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] Adding request header: Accept-Encoding

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] Adding request header: X-Dispatcher-Server

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] Adding request header: Via

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] Adding request header: X-Forwarded-For

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] Adding request header: X-Forwarded-SSL

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] Adding request header: X-Forwarded-SSL-Cipher

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] Adding request header: X-Forwarded-SSL-Session-ID

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] Adding request header: Server-Agent

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] Backend forbids caching, sent: 'Cache-Control: private'

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] response.status = 200

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] response.headers[Date] = "Sat, 30 Jan 2021 00:27:39 GMT"

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] response.headers[X-Content-Type-Options] = "nosniff"

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] response.headers[X-Frame-Options] = "SAMEORIGIN"

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] response.headers[Content-Type] = "text/html;charset=utf-8"

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] response.headers[Cache-Control] = "private"

[Fri Jan 29 19:27:39 2021] [D] [pid 26302] response.headers[Content-Encoding] = "gzip"

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@ak31270718,

If your publisher is responding a content with "Cache-Control: private" it simply means that the resource is user specific and will not be cached on the dispatcher or any CDN but on user's browser.

it seems this header is only is saying dispatcher not the cache the content and this why you are getting "Backend forbids caching" error message.

So to overcome this you need to fix it from AEM level.

 

Hope this will help.

Umesh Thakur

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

@ak31270718,

If your publisher is responding a content with "Cache-Control: private" it simply means that the resource is user specific and will not be cached on the dispatcher or any CDN but on user's browser.

it seems this header is only is saying dispatcher not the cache the content and this why you are getting "Backend forbids caching" error message.

So to overcome this you need to fix it from AEM level.

 

Hope this will help.

Umesh Thakur

Avatar

Level 1
@Umesh_Thakur : I verified AEM publish response and Cache-Control is not part of headers. I checked the logs after putting 'org.eclipse.jetty.server.HttpChannel' in debug mode and also verified by hitting AEM node directly over browser. Any other way to verify/confirm that AEM is adding that header?

Avatar

Community Advisor
@ak, Normally what happens is, we categorise the page and then set appropriate headers from the filter based on the page category requested. So if you are not getting from response header then I think you should check is there any servlet filter implemented this purpose or not.

Avatar

Community Advisor

Hi,

 

It seems that cache control for the particular content area is set to private. Can you check in your aem code AND Dispatcher configs for 'Cache-Control “private”' ?