When configuring BLOB caching for MOSS 2007 and SharePoint 2010, it is possible to specify an optional max-age attribute in the web.config element. This attribute determines the amount of time, in seconds, that SharePoint clients should cache resources locally (typically in the browser’s temporary files area) that are served from a WFE’s BLOB cache. For example, the following web.config element instructs clients to locally store .GIF and .JPG images that are retrieved from the WFE for 43,200 seconds (12 hours) before re-requesting them.
<BlobCache location="C:\blobCache" path="\.(gif|jpg)$" maxSize="10" max-age="43200" enabled="true" />
Resources that are served from a WFE’s BLOB cache when the max-age attribute is used are only re-requested after the max-age interval has elapsed or the browser’s local cache has been cleared. This reduction in client requests being made can save your WFE servers quite a bit of processing at the same time that the end-user experience is improved.
Be warned, though: if BLOB cache resources change on the server before the max-age interval has elapsed, clients that are caching those resources locally won’t see the changes. In order for clients to see the changes before the max-age interval has elapsed, a browser cache flush is necessary.
ReTweet this Tip!
Mar 08 2012, 06:00 AM