www-modproxy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arnauld Dravet" <smur...@egocentrique.com>
Subject Re: mod_cache questions
Date Fri, 07 Jun 2002 13:40:01 GMT
Hi Graham and thanks for your help :)

I've began to check sources of mod_cache so at least i can see what
directives can be used for each submodule (disk & mem).
Will such an httpd.conf work (can't try it yet i'm not @work) ?  A few
things i'm wondering are quoted after the listing.

----------------------------------
##general apache config
LoadModule cache_module modules/mod_cache.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so

##beginning of virtual hosts config
NameVirtualHost 192.168.100.19:80

<VirtualHost 192.168.100.19:80>
ServerName web1.test.com
ProxyRequests on
ProxyPass / http://web1.test.com/
ProxyPassReverse / http://web1.test.com/

CacheOn On
CacheRoot /cache/web1           #directory in which we want to disk cache
this virtualhost
CacheSize 1000000                 #approx 1GB of disk cache for this
virtualhost
CacheExpiryCheck On             #we verify the expiration date of cached
objects
CacheMinFileSize 256000       #we disk cache objects of size >= approx 256KB
CacheMaxFileSize 10000000  #we disk cache objects of size <= approx 10MB
CacheGcUnused 2                   #we erase unused cached objects every 2
hours

MCacheSize 64000                 #approx 64MB allocated for memory cache
MCacheMinObjectSize 1        #we RAM cache objects of size >= 1 byte
MCacheMaxObjectSize 256000 #we RAM cache objects of size <= 256KBytes

TransferLog /dev/null
ErrorLog /logs/1-error.log
</VirtualHost>

<VirtualHost 192.168.100.19:80>
ServerName web2.test.com
ProxyRequests on
ProxyPass / http://web2.test.com/
ProxyPassReverse / http://web2.test.com/


CacheEnable mem /                   #we ram cache the root dir of web2
CacheEnable disk /pictures         #we disk cache
http://web2.test.com/bigfiles/*
CacheEnable mem /bigfiles/thumbnails  #we ram cache
http://web2.test.com/bigfiles/thumbnails/*

CacheRoot /cache/web2           #directory in which we want to disk cache
this virtualhost
CacheSize 500000                   #approx 500MB of cache for this
virtualhost
CacheExpiryCheck Off             #we don't verify the expiration date of
cached objects
CacheMinFileSize 128000        #we disk cache objects of size >= approx
128KB
CacheMaxFileSize 10000000   #we disk cache objects of size <= approx 10MB
CacheGcUnused 5                    #we erase unused cached objects every 5
hours

MCacheSize 128000                 #approx 128MB allocated for memory cache
MCacheMinObjectSize 1          #we RAM cache objects of size >= 1 byte
MCacheMaxObjectSize 128000 #we RAM cache objects of size <= 128KB

TransferLog /dev/null
ErrorLog /logs/2-error.log
</VirtualHost>

-------------------
QUESTIONS ABOUT THIS EXAMPLE:
- Is it better to use CacheOn On in the global section, and tell in each
VirtualHost i don't want to activate caching CaheOn Off, or should i do like
i did, explicitely use CacheOn On in the VirtualHosts i want to cache ?
- Can i still use CacheEnable <type of cache> <URL prefix> if i also use
CacheOn On/Off, in the same VirtualHost ?
- Should i better use <Location> CacheOn On ...</Location> or <Directory>
CacheOn On ... </Directory> to enable cache per directory/location, instead
of using several CacheEnable inside a VirtualHost declaration?
- What happen if CacheMinFileSize < MCacheMaxObjectSize in my example ? Will
mod_cache automatically take the cached object in RAM, which should be
accessed faster than on disk ?
- Finally, is there a way to enable or disable cache per file extension ? ie
deny cache on all files like .php .cgi .asp  or requests using an URL with
parameters (using the '?' character) ?





Thank you again ....
Arnauld

--
Arnauld Dravet
smurfie@egocentrique.com



Mime
View raw message