November Happy Hour will be moved to Thursday December 5th.

Cachning av Css fil. Fördröjning

Vote:
 
Jag har problem med cachning av min css fil. Utgår ifrån samma dir som exempel css-filen. Problemet jag får är att jag kan uppdatera filen 1-3 gånger sen går det inte längre. Om jag byter namn på css-filen och prövar så får jag 3 nya försök men sen återkommer problemet. Jag kan se att ändringen används på sidan men det är precis som om den läser ifrån en äldre version. Efter ca: 10min så får jag nya försök men sen börjar det om. Någon som har upplevt något liknande, vet hur man kan lösa detta? Mvh / Niklas Hjelm
#17784
Mar 05, 2008 13:14
Vote:
 
Hej! Har också varit med om något liknande. För mig löste det sig när jag i IE körde "Tools > Internet options > Delete... > Delete all".. Kanske inte behövs en Delete all, men jag körde det iaf och det funkade. Lycka till! /Erik
#18596
Mar 05, 2008 14:07
Vote:
 
Ctrl+F5 doesn't work? That should make your IE or Firefox browser fetch the css file from disk and not cache. -- Lars Øyvind www.epinova.no
#18597
Mar 10, 2008 9:54
Vote:
 
Always disable the browser cache when developing. The cache can cause some strange behaviour.
#19187
Mar 28, 2008 21:42
Vote:
 

I disagree, disabling the cache only ensure you develop in an evironment different from the one the client uses. Use Ctrl+F5 when you need to refresh the cache. If this does not help, you need to find the real cause of the problem.

As a side note, you should get used to the fact that the only way to truly ensure something will not be cached is to use another name or path. Especially when you've deployed to a production system and need to update it. Something that EPiServer has been inherently bad at (with js and css files under /util spanning different versions of the product.)

/Steve

#19191
Mar 29, 2008 21:07
Vote:
 

I had the same problem with CSS caching.

To resolve this I updated the static file expirationTime setting in web.config in my development environment. Don't forget to restore this when going to production.

 <staticFile expirationTime="0:0:1" />

 /Nils

#28836
Mar 24, 2009 14:52
Vote:
 

Another trick in development is to add something as a parameter to the css file like

<link rel="stylesheet" type="text/css" href="fil.css?<%=DateTime.Now%>" />

that will ensure that you can "debug" your css file without thinking about caching

Just remember to remove the server code when you are finished :)

#28842
Mar 24, 2009 23:53
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.