Enabling Blob Cache in SharePoint 2013

One thing you can do to improve the performance of your SharePoint farm is enabling the Blob Cache. Also this operation is a best practice as I stated some time ago in: https://sharepointrescue.wordpress.com/2015/08/27/fine-tune-sharepoint-performance/

But, what is Blob Cache? Is disk-based cache that controls the caching for binary large objects (BLOBs), such as frequently used image, audio, and video files, and other files that are used to display web pages, such as .css and .js files. It is used on the web servers to reduce the network traffic to and load on the database server.

By default the Blob Cache is disabled and to enable it is necessary to modify a parameter in each web application at web.config level.

It is very simple:

 <BlobCache location="C:BlobCache15" path=".(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|themedbmp|themedcss|themedgif|themedjpg|themedpng|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv|ogg|ogv|oga|webm|xap)$" maxSize="10" enabled="false"> 

Only it is necessary to modify the location (as a best practise it is recommended to store blobs in a different location from the Index and the installation drive) and modify the parameter “enabled”

But what happen if I have multiple servers and multiple web applications? Do I need to enter to each one of the server to modify these properties? Not necessary, you can do it with the following Powershell from Bart’s Hideout

The only thing that you have to do is to copy the code in a ps1 file and execute it as it follows:

./nameoffile.ps1 -url http://urlwebapp -location locationblob

That’s all, you can check your servers and you will see that you have modified the web.config in all web servers, job done!

Hope it helps!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s