Can you all help me to build a proxy server with caching capabilities.
The recommendations are:
- Disk cache every file above 1MB, regardless the headers sent
- Cache should never expire, so once cached files shall never be re-requested to the source
- Requests to port 80 (like a browser) should not throw an error, but present a page saying "This is a proxy"
The reason for me to need this is that i have a very limited bandwidth, and i do not want to download a file twice.
What i have so far:
- Code: Select all
ThreadsPerChild 100
MaxRequestsPerChild 0
ServerRoot "C:\Program Files\Apache Software Foundation\Apache2.2"
Listen 25253
LoadModule status_module modules/mod_status.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
LoadModule disk_cache_module modules/mod_disk_cache.so
ServerName server
DocumentRoot "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs"
ErrorLog logs/error.log
LogLevel debug
<IfModule log_config_module>
LogFormat "%q %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%q %h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%q %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog logs/access.log common
</IfModule>
<IfModule proxy_module>
ProxyRequests on
ProxyVia On
ProxyBadHeader Ignore
ProxyStatus On
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</IfModule>
<IfModule disk_cache_module>
CacheRoot "d:\cache"
CacheDefaultExpire 4320000
CacheMaxExpire 6048000
CacheMaxFileSize 1000000000000
CacheMinFileSize 1
CacheEnable disk /
CacheEnable disk http://
CacheDirLevels 5
CacheDirLength 3
</IfModule>
<IfModule mod_status.c>
ExtendedStatus On
</IfModule>
Thanks in advance for your help!