Http Caching strategies: VPP Files
These strategies applies to EPiServer CMS 5 R2, but all settings will work in R1 even though option 3 won’t get you the extra performance boost over option 2. Remember that you can have different settings for different folders if you like.
#1 Dynamic files
This is currently the default configuration in R2, no files delivered from EPiServer CMS are cached either on the server or at the client. This gives you the worst performance both on the client and on the server but the most up to date content.
<location path="Global">
<staticFile expirationTime="-1.0:0:0"
/>
#2 Client cached files
This is the, in my opinion, minimum configuration you should add when going into production. Files delivered from EPiServer CMS are cached by the browser until expired. By forcing the cache control to private we make sure no other than the clients can cache the content in their browsers.
Consider increasing expirationTime for folders containing files that almost never change.
<location path="Global">
<staticFile expirationTime="1.0:0:0"
cacheControl="private" />
#3 Server+client cached files
This approach will give you the best performance but you may have to live with the fact that if you reuse file names your visitors may not always see the latest version of a file, this applies to the previous option also but now we have two caches to consider. You could rename files or create new files if you really need to push out a new image on the start page at a specific point in time. As with the previous configuration you should consider increasing expirationTime for folders containing files that almost never change.
By setting cache control to auto we tell the static file handler to automatically switch between private and public depending on if the user is logged in or not. When the static file handler returns the public header IIS will kick in and start caching the file (see kernel cache for more info). If you know for sure that this location only contains public files, for example non-secured images, you can force the cache control to public to enable server caching even if the users are logged in.
<location path="Global">
<staticFile expirationTime="1.0:0:0"
cacheControl="auto" />
13 October 2008