Configures cache policy of a static file based on configuration rules
Namespace:
EPiServer.WebAssembly: EPiServer (in EPiServer.dll) Version: 6.0.530.0
Syntax
| C# |
|---|
protected virtual void SetCachePolicy( HttpContext context, DateTime fileChangedDate ) |
Parameters
- context
- Type: System.Web..::.HttpContext
The HttpContext for the current request.
- fileChangedDate
- Type: System..::.DateTime
The changed date for the file that is being requested.
Remarks
Configuration setting expirationTime in web.config states the Expires date that is
added to the Resonse (which browsers typically uses to control how long to cache the file before a new request).
If TimeSpan.Zero is specified in expirationTime no Expires date is added which most browsers will
interpret so they make a request for the file each time but since Last-Modified is added a 304 (Not modified)
will be returned by server if file has not changed.