0

I can't figure out why my browser isn't caching my *.js files. According to chrome it should as the status is 304 and the IIS common response header on the /app_themes/ folder is set to Expire Web Content after 7 days.

google dev tools request

And the request/response headers look ok with matching e-tags:

enter image description here

Is there some other IIS or Kentico setting I'm missing?

Edit: I've also tried opening the home page and a sub page in a new tab as per this answer but to no avail

But... I see it works in Firefox so looks like Chrome is still ignoring the headers in certain circumstances

rory
  • 1,490
  • 3
  • 22
  • 50

2 Answers2

2

It's that no cache in the cache control that's probably to blame. Since you are directly referencing the file it will be in iis that you need to alter the cache control. Follow these instructions for the app theme folder.

https://learn.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/clientcache

If you pull the file through Kentico (there is a special url that you pass the file parth to, can't recall if top of my head but if you add JavaScript using the JavaScript web part it will user this) that I think will then use Kentico settings for file cache and put the proper header

Trevor F
  • 1,429
  • 9
  • 6
1

You probably can check settings\ performance \ client side caching

There are 2 settings "Allow client cache revalidation" and "Cache in minutes". Read the help and play with them