304 not modified on static files 304 not modified on static files asp.net asp.net

304 not modified on static files


Refer Below link and enabling cache manually for contents type based on your requirement and see if its works or not.

https://www.iis.net/configreference/system.webserver/caching


From what I understand, status code 304 means that the server tells the browser, "hey, the image you are requesting has not been changed since xxxx/xx/xx, use your local cache should be fine!". So the discrepancy between your development machine and production server is most likely caused by production server IIS setting.

What you can try for now are:

  • Do "hard reload" to your web page in your web browser (in chrome, you can turn on "developer tool" by click F12, and then right click on the "reload" button, it will give you "empty cache and hard reload" option"
  • On your development machine, try to install IIS instead of IIS express, and run your web application within IIS. There could be some default setting discrepancy between IIS express to your production server IIS, so try to mimic the production server environment on your development machine
  • Try to disable IIS cache explicitly. You can find how to do it here https://serverfault.com/questions/117970/iis-7-returns-304-instead-of-200

Hope this helps!Henry