Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Sets the cache-specific data on the cache provider.
Syntax
virtual VOID SetCacheRecord(
IHttpCacheSpecificData* pCacheRecord
) = 0;
Parameters
pCacheRecord
A pointer to an IHttpCacheSpecificData value.
Remarks
The pCacheRecord parameter must not be NULL, because later internal calls to the GetCacheRecord method may cause an access violation.
Important
The SetCacheRecord method is part of the IIS infrastructure and is not intended to be used directly from your code.
Notes for Implementers
ICacheProvider implementers declare a private``IHttpCacheSpecificData pointer as member data. When constructors of these implementers are called, this member data is assigned to an IHttpCacheSpecificData pointer. Before calling SetCacheRecord, the caller is responsible for first calling IHttpCacheSpecificData::ReferenceCacheData on the IHttpCacheSpecificData pointer; SetCacheRecord implementers then assign the private variable to this IHttpCacheSpecificData pointer.
When SetCacheRecord is called, implementers should first check if the current private member pointer is non-NULL. If the private data is non-NULL, call IHttpCacheSpecificData::DereferenceCacheData first on this current data so that it can be released, but then always assign the private variable to the pCacheRecord parameter.
The following table is a sample of one-to-one interface mappings that must be returned from the GetCacheKey and GetCacheRecord methods from the same implementer of the ICacheProvider interface.
| GetCacheKey interface | GetCacheRecord interface |
|---|---|
| IFileKey | IHttpFileInfo |
| IHttpTokenKey | IHttpTokenEntry |
| IHttpCacheKey | IHttpCacheSpecificData |
Notes for Callers
ICacheProvider implementers take ownership of the IHttpCacheSpecificData pointer. Before calling SetCacheRecord, first call IHttpCacheSpecificData::ReferenceCacheData on the pointer so that this pointer has one owner.
Requirements
| Type | Description |
|---|---|
| Client | - IIS 7.0 on Windows Vista - IIS 7.5 on Windows 7 - IIS 8.0 on Windows 8 - IIS 10.0 on Windows 10 |
| Server | - IIS 7.0 on Windows Server 2008 - IIS 7.5 on Windows Server 2008 R2 - IIS 8.0 on Windows Server 2012 - IIS 8.5 on Windows Server 2012 R2 - IIS 10.0 on Windows Server 2016 |
| Product | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 - IIS Express 7.5, IIS Express 8.0, IIS Express 10.0 |
| Header | Httpserv.h |