Expand my Community achievements bar.

SOLVED

AEM CS - Avoid Cache for specific file

Avatar

Level 4

Hello Team,

We have to remove caching for specific file and have configured in vhost with below rules.

 

# For Remove caching for i18n files
<LocationMatch "^/etc\.clientlibs/myproject/clientlibs/clientlib-site/resources/i18n/.*\.$">
Header Set Pragma "no-cache"
Header Set Cache-Control "max-age=0, no-store, no-cache, must-revalidate"
Header Unset ETag
FileETag None
</LocationMatch>

 

But file getting cached and seeing response header like below

age: 64439

cache-control: max-age=86400, public

 

Can you please advise on how we can achieve avoiding cache this ?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
2 Replies

Avatar

Correct answer by
Community Advisor

Avatar

Level 4

Hi @Nitin_laad thanks for your reply. 

 

For me, its resolved with below updated expression. I had small issue regex hence path was not matching.

 

<LocationMatch "^/etc\.clientlibs/myproject/clientlibs/clientlib-site/resources/i18n/.*\.json$">