2

I'm currently working with a site which has the blobcache enabled on the production environment with the following settings in the web.config:

<BlobCache location=”D:\BlobCache” path=”\.(gif|jpg|png|css|js|swf|flv|f4v)$” max-age=”3600” maxSize=”10” enabled=”true”/>

In one section of the site there is a piece of functionality which allows a user to change the details of an item which will regenerate a thumbnail image (jpg).

An issue has arisen where the user will update this content and a new image will be generated, however due to the blobcache setting the max-age to 3600, when they are redirected to the listing page, they are seeing the cached local copy. Hitting F5 to refresh the page will update it and get the latest version.

With blobcaching disabled obviously this does not occur. So my question would be does anyone know a way to exclude a bunch of jpg files under a certain path from the blobcache without removing it completely from the allowed filetypes in the web.config.

Thanks in advance

3 Answers 3

3

The BLOB cache is enabled per web application so would it be possible to save the thumbnails in a seperate web app where the BLOB cache is disabled?

Another idea would be to generate a new file each time instead of updating the existing one so the BLOB cache would not contain a cached copy.

1

The path setting is a RegEx value allowing you to include exclusions as part of the value.

Example:

  • If the thumbnail you don't want cached is called MyThumb.jpg
  • You can use the following BlobCache Path Value to exclude it.

    path="(?&lt ;!/MyThumb)\.(gif|jpg|png|css|js|swf|flv|f4v)$"

-1

Suppose I have few heavy .jpeg and .dhx in a spdocumentLibrary called HeavyContent .

I want to cache all .pdf , .doc ,.docx ,.flv,.f4v ,.swf in my web application , but .jpeg and .dhx are the one only from spdoc lib “HeavyContent”

Search for a tag similar to below mentioned in web.config and edit the path parameter. :

This will mark items as specified by path parameter regex for 24 hrs , to be cached.

.(doc|docx|pdf|swf|flv|f4v)$ <—-> everything which ends with extension mentioned

| <—-> or

HeavyContent.*.(dhx|jpeg)$ <—-> content inside HeavyContent ending with dhx or jpeg

Disclaimer : I am not sure how performance will be affected by making path parameter complex.

References: Best practices for Blob cache and

Include specific folder content in BlobCache SharePoint

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.