Answer the question
In order to leave comments, you need to log in
How to set up caching of static files in asp.net?
Good afternoon! Previously, I did not work with asp, the task arose to configure caching of css files. I found this instruction:
metanit.com/sharp/mvc5/20.5.php
I do as it says, I inserted it into web.config
<system.webServer>
<staticContent>
<clientCache cacheControlCustom="public;max-age" cacheControlMaxAge="10.00:00:00" cacheControlMode="UseMaxAge" />
</staticContent>
</system.webServer>
Answer the question
In order to leave comments, you need to log in
I'm sorry, but why do you need to manually cache css? Do you update it every 5 minutes? And after updating the application, hang a sticker - "do not forget to reset the cache." Asp.net has a StyleBundle mechanism that will glue your css for you and will control versioning - when it changes, it will update the hash and the client will pick up new styles using the new link received.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question