mod_cache_disk.h revision 5447b616f660d11019afc5230ef34ca34d2d8fc7
/* 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_CACHE_DISK_H
#define MOD_CACHE_DISK_H
#include "apr_file_io.h"
#include "cache_disk_common.h"
/*
* include for mod_cache_disk: Disk Based HTTP 1.1 Cache.
*/
typedef struct {
const char *file;
apr_file_t *fd;
char *tempfile;
/*
* 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 */
const char *prefix;
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_cache_disk 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 {
unsigned int minfs_set:1;
unsigned int maxfs_set:1;
unsigned int readsize_set:1;
unsigned int readtime_set:1;
#endif /*MOD_CACHE_DISK_H*/