Hi Team
I'm hoping someone can help clarify an issue I'm facing with caching SVG assets in ClientLibs. I have implemented rules in the dispatcher (similar to the ones below) that should ideally set a max-age for assets within the ClientLibs loaded via etc.clientlibs
. However, when I run a Lighthouse report, I'm not seeing any of the SVG assets in the resources folder being cached properly.
<LocationMatch "^/etc\.clientlibs/.*\.(?i:json|png|gif|jpe?g|svg)$">
Header set Cache-Control "max-age=15780000,s-maxage=86400,stale-while-revalidate=43200,stale-if-error=43200,public"
Header set Age 0
</LocationMatch>
I've verified that:
I am not sure if it is not applying only for SVG from etc.clientlibs
. or other assets like JPEG or PNG as I do not have such files in resources as of now. I cannot deploy them as this issue is observed in the client server.
AEM version: AEM As Cloud
TIA
Veena✌
Topics help categorize Community content and increase your ability to discover relevant content.
Hi @VeenaVikraman
On AEMaaCS, you have to disabled the default rules
@arunpatidar But it says , that is for HTML/TEXT
@VeenaVikraman There should be any issue with default.any file as by default we allow all files to get cache.. Please check your cache rules files if it is not having any space or typo. Also, please check logs
@Imran__Khan The rule in my OP is the exact rule , we have in the dispatcher. Do you see any issue with this rule ? I checked for typos. Doesn't seem to have any space.
@VeenaVikraman you can try to add a path independent rule like -
<LocationMatch "\.(jpg|jpeg|png|gif|svg|bmp)$">
Header set Cache-Control "max-age=2592000, s-maxage=31536000, stale-while-revalidate=30, stale-if-error=60, public"
</LocationMatch>
@VeenaVikraman Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies