Loads a file into a cache associated with a Fast Response Cache Accelerator (FRCA) instance.
FRCA Library (libfrca.a)
#include <frca.h>
int32_t FrcaCacheLoadFile ( CacheHandle, FrcaHandle, FileSpec, AssocData);
int32_t CacheHandle;
int32_t FrcaHandle;
frca_filespec_t * FileSpec;
frca_assocdata_t * AssocData;
The FrcaCacheLoadFile subroutine loads a file into an existing cache instance for an previously configured FRCA instance.
CacheHandle | Identifies the cache instance to which the new entry should be added. |
FrcaHandle | Identifies the FRCA instance to which the cache instance belongs. |
FileSpec | Points to a frca_loadfile_t structure, which specifies
characteristics used to identify the cache entry that is to be loaded into the
given cache. The structure contains the following members:
uint32_t cacheEntryType; char * fileName; char * virtualHost; char * searchKey;
Note: Structure members do not necessarily appear in this order.
Note: If a cache entry with the same type, file name, virtual host, and search key already exists and the file has not been modified since the existing entry was created, the load request succeeds without any effect. If the entry exists and the file's contents have been modified since being loaded into the cache, the cache entry is updated. If the entry exists and the file's contents have not changed, but any of the settings of the HTTP header fields change, the existing entry must be unloaded first. |
AssocData | Points to a frca_assocdata_t structure, which specifies
additional information to be associated with the contents of the given cache
entry. The structure contains the following members:
uint32_t assocDataType; char * cacheControl; char * contentType; char * contentEncoding; char * contentLanguage; char * contentCharset;
Note: Structure members do not necessarily appear in this order.
|
0 | The subroutine completed successfully. |
-1 | The subroutine failed. The global variable errno is set to indicate the specific type of error. |
EINVAL | The FileSpec or the AssocData parameter is zero or are not of the correct type or any of the fileName or the searchKey components are zero or the size of the file is zero. |
EFAULT | The FileSpec or the AssocData parameter or one of their components points to an invalid address. |
ENOMEM | The FRCA or NBC subsystem is out of memory. |
EFBIG | The content of the cache entry failed to load into the NBC. Check network options nbc_limit, nbc_min_cache, and nbc_max_cache. |
ENOTREADY | The kernel extension is currently being loaded or unloaded. |
ENOENT | The CacheHandle or the FrcaHandle parameter is invalid. |
The FrcaCacheCreate subroutine, FrcaCacheDelete subroutine, FrcaCacheUnloadFile subroutine, FrcaCtrlCreate subroutine, FrcaCtrlDelete subroutine, FrcaCtrlLog subroutine, FrcaCtrlStart subroutine, FrcaCtrlStop subroutine.