Disable cache for 404 ONLY | Community
Skip to main content
January 26, 2024
Solved

Disable cache for 404 ONLY

  • January 26, 2024
  • 2 replies
  • 992 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by DPrakashRaj

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”

 

 

2 replies

DPrakashRaj
Community Advisor
DPrakashRajCommunity AdvisorAccepted solution
Community Advisor
January 26, 2024

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”

 

 

arunpatidar
Community Advisor
Community Advisor
January 26, 2024
Arun Patidar