This is a feature for Microsoft
SQL Server and this is designed to move the storage of binary large objects
(BLOB) from database server to a disk storage location. It reduces the database
load and increases the browser performance. It is very useful for frequently
used images, audio, video and other media type files. The BLOB cache is enabled
in front-end server and improves the performance by retrieving the BLOB files
from database to a directory. This reduces the network traffic between
SharePoint and database server.
Before use BLOB cache we have to
well plan weather this will improve performance or not. If most of the files in
a site are static, the files are not getting updated frequently and it contain
many read-only media files, enabling BLOB cache will improve the performance.
You must specify a storage
location to store the files in the front-end web server. The storage location
should have enough disk space to store the cache. And also select a drive that
will be used by few processes as possible.
The BLOB caching is done at the
Web application level. All the site collections under the web applications will
be effected. By default the BLOB cache is off.
To configure BLOB cache
1. Open
IIS in the SharePoint server and click on the specific web application
2. Right
click on the name of the web application and click Explorer.
3. Open
the web.config file. Before make changes to the web.config file. It is good to
keep a copy of that.
4. Find
the tag and change the attributes
5. Change
the location attribute to specify the directory to cache the files.
Ex: location="C:\BLOB"
Microsoft recommends
specifying a directory that is not the same drive as the Operating System runs.
6. For
the path attribute modify the regular expression to add/remove file extension. These
types of files will be cached at the specified location.
7. maxSize
is the maximum allowable size of the disk based cache in GBs. 10 GB is the
default size.
8. enabled
attribute enable/disable the cache. Set it to true.
9. max-age
specify the maximum amount of time in seconds that the client browser caches
BLOB. The default value is 86400 seconds (24 hours).
10. Save
the web.config file.
Your BlobCache tag looks like
this
<BlobCache location="C:\BLOB"
path="\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv)$"
maxSize="10"
enabled="true" />
When you change the web.config
file, the web application in IIS automatically recycles. The recycling can
cause some interruption in the services to sites contained in that web
application.
After the recycling process, if you
go the directory you specified in the location attribute (C:\BLOB), you will
see some set of files like Change.bin, dump.bin, flushcount.bin, etc.. This files
contain information about the cached files.
To do the test on BLOB cache
1. Upload
a .wmv file to the Shared Documents library.
2. Try
to download the file to the client computer.
3. Go
to the location directory (C:\BLOB). You can see the file is stored in this
location. In my case my site collection name is ‘Test 1’ and I upload the
documents to Shared Documents. The .wmv file stored in ..\ SITES\TEST1\SHARED
DOCUMENTS
Every time when a new file
rendered from database, it will be stored in the disk drive. The .bin files
will get updated with index and other metadata information.
Once you upload a file to a
library you will not find the file in the disk drive immediately. It will be
stored to the disk only when you start download. And the file will be there for
the time period specified in the max-age attribute.