IIS CSS Caching
If you're serving your CSS from static files (or anything that the query string doesn't matter for), try varying that to ensure that the browser makes a fresh request, as it will think that it's pulling a completley different resource, so have for example:
"styles.css?token=1234" in the CSS reference in your markup and change the value of "token" on each CSS check-in
Caching specific Javascript and CSS files
You can configure IIS to cache specific files by extension. For example:
Select the folder where your css/js files reside and then click on Output Caching.
Then add the file extensions that you want to cache:
I don't think you can specify which ones to cache on a per file basis unless you write an http handler module to add the appropriate headers for each file independently, but from IIS this is how is done.
Then you can verify that you are getting 304 responses using firebug / fiddler or your tool of choice.
I hope this is helpful.
Chrome will not cache CSS files. .js files work fine
I faced similar kind of issue and turns out to be web.config's compilation attribute was set to debug=true, as-
<compilation debug="true"></compilation>
It causes your files to neither be bundled nor cached on browser. Just removing debug=true resolved my issue. So I changed it to-
<compilation></compilation>
Edit-
For Chrome specifically, it could be related to your certificate.
Chrome does not cache resources from servers with self-signed certificate.
See here
How to configure cache on IIS 10?
It looks like you have enabled both clientcache
and server side output caching at the same time. Based on your description, only client-side cache is required in this case.
So please remove output caching rule from your IIS configuration.
We just have to set <clientcache>
section
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00" />
</staticContent>
Besides, please ensure your web browser has enabled client caching. Otherwise, static files will never be cached.
Of course, failed request tracing will tell us how the cache control header generated.
https://learn.microsoft.com/en-us/iis/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis
Related Topics
CSS Transition - Two Directions
Fixed Position Misbehaviour in Ie11
Font Color in HTML Email - Gmail
Changing Background Colors of Grid Rows Dynamically in Extjs 4.2.2
What Is Result of Calc() in CSS
Borderradius Style Property Not Rounding The Edges in Reactjs
How to Draw Triangle with Transparent Background with Border
How to Pass Value from Ts File to SCSS File in Same Component in Angular 2+
Why Is This Page Layout Breaking When an Anchor Link Is Used
Do You Put Ie Conditionals in The CSS File or in The HTML File
Make Fixed Header Scroll Horizontal
Align Material Icon Vertically
Ionic Item with Left and Right Aligned Text
How to Use CSS to Justify Text with Hyphenating Words at The End of a Line
Use CSS to Target Any Element That Has Any Two Classes on It