You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Igor Galić <i....@brainsware.org> on 2010/06/01 17:58:22 UTC

Re: [users@httpd] Apache as caching proxy

----- "Nilesh Govindarajan" <li...@itech7.com> wrote:

> Hi,
> 
> I have an installation of Apache running, so thinking of using it as
> a
> personal caching server after being fed up of firefox crashes which
> clears the cache.
> I have set it up using the manual and some guides using Google, but
> how do I know that its working ?
> Here are my settings:

Before saying anything I should tell you that Apache httpd is not really
recommended as Forward Proxy. There are better alternatives, (even!) Squid
being one of them.

> ProxyRequests On
> ProxyVia Off
> ProxyBadHeader Ignore
> ProxyStatus On
> <Proxy *>
> Order deny,allow
> Deny from All
> Allow from 192.168.1.0 127.0.0.1 localhost
> </Proxy>
> AllowCONNECT 443
> CacheDefaultExpire 3600
> CacheMaxExpire 604800
> CacheIgnoreCacheControl On
> CacheStorePrivate On
> CacheStoreNoStore On
> CacheIgnoreNoLastMod On
> CacheRoot /home/proxy_cache
> CacheEnable disk /
> CacheMaxFileSize 5242880
> CacheIgnoreURLSessionIdentifiers jsessionid PHPSESSID sid
> 
> What happens if I remove the CacheMaxExpire directive ? Will Apache
> check for the document's last-modified time ?
> I would like latest stuff on websites I visit, so please guide me in
> the right direction.

http://httpd.apache.org/docs/2.2/mod/mod_cache.html#cachemaxexpire

I think the documentation is quite clear on this:
``Thus, documents will be out of date at most this number of seconds. This maximum value is enforced even if an expiry date was supplied with the document.''

If you remove the directive it will fall back to:

Default:	CacheMaxExpire 86400 (one day)

What you probably want to do is invalidate the cache, but that can only be done with
htcacheclean from trunk so far: http://httpd.apache.org/docs/trunk/programs/htcacheclean.html
Which again only makes sense in a reverse proxy setup....

So long,

-- 
Igor Galić

Tel: +43 (0) 699 122 96 338
Fax: +43(0) 1 91 333 41
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache as caching proxy

Posted by Nilesh Govindarajan <li...@itech7.com>.
2010/6/1 Igor Galić <i....@brainsware.org>:
>
> ----- "Nilesh Govindarajan" <li...@itech7.com> wrote:
>
>> Hi,
>>
>> I have an installation of Apache running, so thinking of using it as
>> a
>> personal caching server after being fed up of firefox crashes which
>> clears the cache.
>> I have set it up using the manual and some guides using Google, but
>> how do I know that its working ?
>> Here are my settings:
>
> Before saying anything I should tell you that Apache httpd is not really
> recommended as Forward Proxy. There are better alternatives, (even!) Squid
> being one of them.
>
>> ProxyRequests On
>> ProxyVia Off
>> ProxyBadHeader Ignore
>> ProxyStatus On
>> <Proxy *>
>> Order deny,allow
>> Deny from All
>> Allow from 192.168.1.0 127.0.0.1 localhost
>> </Proxy>
>> AllowCONNECT 443
>> CacheDefaultExpire 3600
>> CacheMaxExpire 604800
>> CacheIgnoreCacheControl On
>> CacheStorePrivate On
>> CacheStoreNoStore On
>> CacheIgnoreNoLastMod On
>> CacheRoot /home/proxy_cache
>> CacheEnable disk /
>> CacheMaxFileSize 5242880
>> CacheIgnoreURLSessionIdentifiers jsessionid PHPSESSID sid
>>
>> What happens if I remove the CacheMaxExpire directive ? Will Apache
>> check for the document's last-modified time ?
>> I would like latest stuff on websites I visit, so please guide me in
>> the right direction.
>
> http://httpd.apache.org/docs/2.2/mod/mod_cache.html#cachemaxexpire
>
> I think the documentation is quite clear on this:
> ``Thus, documents will be out of date at most this number of seconds. This maximum value is enforced even if an expiry date was supplied with the document.''
>
> If you remove the directive it will fall back to:
>
> Default:        CacheMaxExpire 86400 (one day)
>
> What you probably want to do is invalidate the cache, but that can only be done with
> htcacheclean from trunk so far: http://httpd.apache.org/docs/trunk/programs/htcacheclean.html
> Which again only makes sense in a reverse proxy setup....
>
> So long,
>
> --
> Igor Galić
>
> Tel: +43 (0) 699 122 96 338
> Fax: +43(0) 1 91 333 41
> Mail: i.galic@brainsware.org
> URL: http://brainsware.org/
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


I know about Squid and tried that, but after many unsucessful attempts
configuring it and no time to research on Google, I decided to use
Apache.
Well, the caching is working well now without any problems.

-- 
Nilesh Govindarajan
Facebook: nilesh.gr
Twitter: nileshgr
Website: www.itech7.com
Cheap and Reliable VPS Hosting: http://j.mp/arHk5e

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org