Skip to content

SPBlobCacheSettings

Brian Farnhill edited this page Jun 25, 2016 · 19 revisions

Parameters

Parameter Attribute DataType Description Allowed Values
WebAppUrl Key string The URL of the web application
Zone Required string The zone of the web application for which blob cache has to be configured Default, Intranet, Internet, Custom, Extranet
EnableCache Required Boolean Specify if the blob cache has to be enabled
Location Write string The location where the blob cache has to store its files
MaxSizeInGB Write Uint16 The maximum size (in GB) of disk space the blob cache is allowed to use
MaxAgeInSeconds Write Uint32 The maximum age (in seconds) that a browser caches a blob
FileTypes Write string Specify the file types that must be stored by the blob cache
InstallAccount Write String POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5

Description

This resource is used to configure the Blob Cache settings for a web application.

Important: This resource only configures the local server. It changes the web.config file directly and is NOT using the SPWebConfigModifications class. In order to configure all WFE servers in the farm, you have to apply this resource to all servers.

Note:

  • In order to prevent inconsistancy between different web front end servers, make sure you configure this setting on all servers equally.
  • If the specified folder does not exist, the resource will create the folder.

Best practice: Specify a directory that is not on the same drive as where either the server operating system swap files or server log files are stored.

Example

SPBlobCacheSettings BlobCacheSettings 
{
    WebAppUrl = "http://intranet.contoso.com"
    Zone = "Default"
    EnableCache = $true
    Location = "F:\BlobCache"
    MaxSizeInGB = 10
    FileTypes = "\.(gif|jpg|png|css|js)$"
    PsDscRunAsCredential = $InstallAccount
}
Clone this wiki locally