Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Reset Client Cache in EPiserver DXC environment

Vote:
 

Hi,

Can anyone help me regarding - how to reset the OLD client cache of CSS and JS files. We are facing issue after  deployment that, CSS and JS files are not updated automatically. We have to wait for cache time to expire. Any way to remove the ccahe after deployment in EPiserver DXC environment.

Thanks,

Avin

#186327
Dec 18, 2017 7:08
Vote:
 

Might want to add a query string parameter to all gui files like 

(URL).main.css?v=1.0.1

where you can auto generate version number from assembly info. If you use css or js bundling and minification they usually do something similar to avoid cache problems (they usually append a hashed key of the content so if the content of the css changes the hashkey in the URL will be changed too and the client will be forced to request the file again). So adding that will both improve performance and solve your caching problems.

Adding support for bundling and minification is so simple today so I would recommend that route. It's a few hours of work and then you get improved performance on the entire website "for free".

#186332
Edited, Dec 18, 2017 9:37
Vote:
 

You can use ETags for the DXC to more granualarly control when the CDN cache is cleared thereforce allowing a long cache header but an ETag to force an update when you need. Possibly via code or adding a version config attribute/admin area.

#186334
Dec 18, 2017 9:43
Vote:
 

Or Like Daniel said add querystrings, also you could bundle your assets together so they have a unique URL, that's what we do and it works.

#186335
Dec 18, 2017 9:44
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.