Operating System - Linux
1821245 Members
2723 Online
109632 Solutions
New Discussion юеВ

configure squid to retun some sties always from its cache ?

 
SOLVED
Go to solution
Maaz
Valued Contributor

configure squid to retun some sties always from its cache ?

Dear Experts

is it possible to configure squid to always return some sites from its cache ? if yes then plz let me know HOW ?

say I want that when anyone want to access http://mail.yahoo.com, or http://www.hotmail.com squid always return the page from its cache.

is it possible ?

plz help
Regards
5 REPLIES 5
Ivan Krastev
Honored Contributor

Re: configure squid to retun some sties always from its cache ?

Use refresh_pattern. Foe example:

refresh_pattern mail.yahoo.com 259200 100% 259200 ignore-reload
override-expire override-lastmod always-cache

regards,
ivan
Steven E. Protter
Exalted Contributor

Re: configure squid to retun some sties always from its cache ?

Shalom Maaz,

This will probably make the sites functionally useless in short order.

Both hotmail and yahoo frequently update their sites and improve security. You users will in some short weeks be unable to use their mail at all. The performance benefit from such a change would be very small.

What might help would be more memory on the squid server to assist it in caching what can be cached.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Maaz
Valued Contributor

Re: configure squid to retun some sties always from its cache ?

Thanks Dear Ivan Krastev and SEP for help/reply

when I put the refresh_pattern option in squid.conf as per your instruction, I got the following error

# squid -k recon
2007/05/02 11:16:09| redreshAddToList: Unknown option 'mail.yahoo.com': always-cache

i even put the "regex" in the refresh_pattern as
refresh_pattern regex mail.yahoo.com 259200 100% 259200 ignore-reload .......
# squid -k recon
FATAL: Bungled squid.conf line 2074: refresh_pattern regex mail.yahoo.com 259200 100% 259200 ignore-reload override-expire override-lastmod always-cache
Squid Cache (Version 2.6.STABLE12): Terminated abnormally.

Thanks SEP for your kind suggestions.. but I am doing in LAB ... infect we have achieved the target using MS ISA 2k/2004, but the same has to be achieved using squid .. we are comparing

Thanks n Regards
Maaz
Ivan Krastev
Honored Contributor
Solution

Re: configure squid to retun some sties always from its cache ?

Hi Maaz,

I tested with this one:

refresh_pattern ^yimg.com 259200 100% 259200 ignore-reload


this is for yimg.com domain (yahoo images) and all seems to be ok.

regards,
ivan
Maaz
Valued Contributor

Re: configure squid to retun some sties always from its cache ?

Thanks Ivan krastev for such a nice help ;)