mod_disk_cache.h revision b7557ab9828d2017224a12968f82c3118b6a8c0a
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MOD_DISK_CACHE_H
#define MOD_DISK_CACHE_H
/*
* include for mod_disk_cache: Disk Based HTTP 1.1 Cache.
*/
#define VARY_FORMAT_VERSION 3
#define DISK_FORMAT_VERSION 4
#define CACHE_HEADER_SUFFIX ".header"
#define CACHE_DATA_SUFFIX ".data"
#define CACHE_VDIR_SUFFIX ".vary"
#define AP_TEMPFILE_PREFIX "/"
#define AP_TEMPFILE_BASE "aptmp"
#define AP_TEMPFILE_SUFFIX "XXXXXX"
typedef struct {
/* Indicates the format of the header struct stored on-disk. */
/* The HTTP status code returned for this response. */
int status;
/* The size of the entity name that follows. */
/* The number of times we've cached this entity. */
/* Miscellaneous time values. */
/*
* disk_cache_object_t
* Pointed to by cache_object_t::vobj
*/
typedef struct disk_cache_object {
const char *root; /* the location of the cache directory */
char *tempfile; /* temp file tohold the content */
const char *prefix;
const char *datafile; /* name of file where the data will go */
const char *hdrsfile; /* name of file where the hdrs will go */
const char *hashfile; /* Computed hash key for this URI */
const char *name; /* Requested URI without vary bits - suitable for mortals. */
const char *key; /* On-disk prefix; URI with Vary bits (if present) */
/*
* mod_disk_cache configuration
*/
/* TODO: Make defaults OS specific */
#define DEFAULT_DIRLEVELS 2
#define DEFAULT_DIRLENGTH 2
#define DEFAULT_MIN_FILE_SIZE 1
#define DEFAULT_MAX_FILE_SIZE 1000000
#define DEFAULT_READSIZE 0
#define DEFAULT_READTIME 0
typedef struct {
const char* cache_root;
int dirlevels; /* Number of levels of subdirectories */
int dirlength; /* Length of subdirectory names */
typedef struct {
int readsize_set;
int readtime_set;
#endif /*MOD_DISK_CACHE_H*/