Last post Oct 19, 2020 08:07 AM by Jerry Cai
Oct 18, 2020 10:22 AM|TDP|LINK
i have bundle cs and js files. load js and css from those bundle into layout pages like this way
Bundle this way
Refer file from bundle this way in layout page
<link rel="icon" href="@Url.Content("~/Content/favicon_32x32.png")" />
Site is hosted in IIS but when running the site from chrome browser then every time js and css bundle is downloading at client side which increase page download time.
this is also set in web.config file for static file caching
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
a screen shot link . https://pasteboard.co/Jwcq213.png
please advise me what i am missing for which js and css file is downloading ever time by browser. thanks
Oct 18, 2020 01:15 PM|mgebhard|LINK
I can't reproduce this issue when following the official documentation. I can only guess what might be wrong on your end.
Make sure debug is set to false and you deployed a release version of the application. Make sure your test is not flawed. Expand the "size" column in dev tools to see if the file is loaded from disk.
Oct 18, 2020 04:27 PM|bruce (sqlwork.com)|LINK
Also check if your browser has caching disabled when dev tools are open.
Oct 19, 2020 07:18 AM|TDP|LINK
Sir i have checked there was no debug = true or debug = false element in web.config file because i have publish the site to folder first before deploy to IIS.
Not clear what is wrong. do i need to set anything in IIS end ? thanks
Oct 19, 2020 07:19 AM|TDP|LINK
i am testing with chrome. how to see cache is disabled or not ?
Oct 19, 2020 08:07 AM|Jerry Cai|LINK
Check your expires header first.
Generally speaking, bundles will set the HTTP expires header for one year from when the bundle is created.
When js files are changed, they need time to loading at the first time, and if the files remain unchanged, they will always be called from memory