Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Disable cache for 404 ONLY

Avatar

Level 2

Hello,

 

I have configured an ErrorDocument 404 /content/site/error/404.html; however, I have noticed that this content is being cached on the dispatcher server, for example, at /mnt/var/www/html/content/site/error/404.html. I need to prevent this as the URLs displayed in 404.html change based on cookies and the URL. What alternatives exist to avoid caching?

 

I have tried the code discussed on the following site, but in neither of the two cases, it has worked for me. Additionally, with 'Location,' it gives me an error when restarting the dispatcher

https://serverfault.com/questions/930180/disable-cache-for-404-only-in-apache-2-2

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

In the cache section of your dispatcher farm configuration you can add another rule to deny caching for the error/404.html

 

/glob “/content/site/error/404.html”

/type “deny”

 

 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

In the cache section of your dispatcher farm configuration you can add another rule to deny caching for the error/404.html

 

/glob “/content/site/error/404.html”

/type “deny”

 

 

Avatar

Community Advisor

Hi @Juan_CarlosRa 
Please check the dispatcher cache configuration here and deny the cache rule for 404 page as mentioned by @DPrakashRaj 

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



Arun Patidar