00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef MOD_DISK_CACHE_H
00018 #define MOD_DISK_CACHE_H
00019
00020
00021
00022
00023
00024 #define VARY_FORMAT_VERSION 3
00025 #define DISK_FORMAT_VERSION 4
00026
00027 #define CACHE_HEADER_SUFFIX ".header"
00028 #define CACHE_DATA_SUFFIX ".data"
00029 #define CACHE_VDIR_SUFFIX ".vary"
00030
00031 #define AP_TEMPFILE_PREFIX "/"
00032 #define AP_TEMPFILE_BASE "aptmp"
00033 #define AP_TEMPFILE_SUFFIX "XXXXXX"
00034 #define AP_TEMPFILE_BASELEN strlen(AP_TEMPFILE_BASE)
00035 #define AP_TEMPFILE_NAMELEN strlen(AP_TEMPFILE_BASE AP_TEMPFILE_SUFFIX)
00036 #define AP_TEMPFILE AP_TEMPFILE_PREFIX AP_TEMPFILE_BASE AP_TEMPFILE_SUFFIX
00037
00038 typedef struct {
00039
00040 apr_uint32_t format;
00041
00042 int status;
00043
00044 apr_size_t name_len;
00045
00046 apr_size_t entity_version;
00047
00048 apr_time_t date;
00049 apr_time_t expire;
00050 apr_time_t request_time;
00051 apr_time_t response_time;
00052 } disk_cache_info_t;
00053
00054
00055
00056
00057
00058 typedef struct disk_cache_object {
00059 const char *root;
00060 apr_size_t root_len;
00061 char *tempfile;
00062 const char *prefix;
00063 const char *datafile;
00064 const char *hdrsfile;
00065 const char *hashfile;
00066 const char *name;
00067 const char *key;
00068 apr_file_t *fd;
00069 apr_file_t *hfd;
00070 apr_file_t *tfd;
00071 apr_off_t file_size;
00072 disk_cache_info_t disk_info;
00073 } disk_cache_object_t;
00074
00075
00076
00077
00078
00079
00080 #define CACHEFILE_LEN 20
00081 #define DEFAULT_DIRLEVELS 3
00082 #define DEFAULT_DIRLENGTH 2
00083 #define DEFAULT_MIN_FILE_SIZE 1
00084 #define DEFAULT_MAX_FILE_SIZE 1000000
00085
00086 typedef struct {
00087 const char* cache_root;
00088 apr_size_t cache_root_len;
00089 int dirlevels;
00090 int dirlength;
00091 apr_off_t minfs;
00092 apr_off_t maxfs;
00093 } disk_cache_conf;
00094
00095 #endif