How to replace specific objects in squid cache?

General discussion about PLUC and Linux in Pakistan.

How to replace specific objects in squid cache?

Postby asaddotcom » Wed Aug 24, 2005 9:33 pm

hi fellows,

AoA

My Question is that how to replace small objects which are stored in squid cache... i.e I have open my web site under squid and it will save all objects to his own cache. Furtherly i need to change any of picture in my web site and i do change one of small JPG file from my web site. Now when i have open again my web site... there i look old one picture :(

I have wait 2 days kay shayed khudi replace ho jaye but its not...
now tell me how to replace this picture from squid cache ?
picture file name is image3.jpg .

best of luck.....

Rgds.

Asad Ali
Thanking You...

ครค๔
www.apnicollection.com | www.wikisoft.pk
asaddotcom
Company Havaldaar Major
 
Posts: 195
Joined: Fri Feb 04, 2005 7:21 pm
ICQ: 172131405
Website: http://www.apnicollection.com
WLM: asaddotcom@msn.com
Yahoo Messenger: asaddotcom2002@yahoo.com
AOL: AsadDotCom
Location: Lahore, PK

Re:

Postby LinuxFreaK » Thu Aug 25, 2005 1:10 am

Dear asaddotcom,
Salam,

FYI, http://linux.cudeso.be/linuxdoc/squid.php

Best Regards.
Farrukh Ahmed
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi

Re:

Postby asaddotcom » Thu Aug 25, 2005 6:33 pm

LinuxFreaK wrote:Dear asaddotcom,
Salam,

FYI, http://linux.cudeso.be/linuxdoc/squid.php

Best Regards.


Dear LF,

AoA

I have not found my question's answer from this site... there is only a squid documention which i have allready know. please do read my question again and tell me suitable answer.

Rgds.

Asad Ali
Thanking You...



ครค๔

www.apnicollection.com | www.wikisoft.pk
asaddotcom
Company Havaldaar Major
 
Posts: 195
Joined: Fri Feb 04, 2005 7:21 pm
ICQ: 172131405
Website: http://www.apnicollection.com
WLM: asaddotcom@msn.com
Yahoo Messenger: asaddotcom2002@yahoo.com
AOL: AsadDotCom
Location: Lahore, PK

Re: How to replace specific objects in squid cache?

Postby compucated » Fri Aug 26, 2005 10:49 pm

asaddotcom wrote:My Question is that how to replace small objects which are stored in squid cache... i.e I have open my web site under squid and it will save all objects to his own cache. Furtherly i need to change any of picture in my web site and i do change one of small JPG file from my web site. Now when i have open again my web site... there i look old one picture :(


Let me to tell you some facts first.
Squid is not such non-efficenit proxy with which you have to purge expired contents manually. It have its own mechanism to purge expired contents.
The situation you are facing is either due to your miss-configuration of squid or with same silly stuff with your ISP.

Several administartors of Pakistani ISP's configure their squids to cached dynamic contents and to "convert client no-cache or "reload'' requests into If-Modified-Since requests" which is violation of laws infact.
See reload_into_ims tag http://squid.visolve.com/squid/squid24s1/miscellaneous.htm#reload_into_ims for more info.

So I suggest you to check your ISP first, might this problem is occuring from you ISP's cache. (browse without your own proxy to check this issue).

Now back to your question, How can I purge an object from my cache?

Squid does not allow you to purge objects unless it is configured with access controls in squid.conf. First you must add something like

acl PURGE method purge
acl localhost src 127.0.0.1
http_access allow purge localhost
http_access deny purge


The above only allows purge requests which come from the local host and denies all other purge requests.

To purge an object, you can use the client program:

squidclient -m PURGE http://www.cnn.com/

If the purge was successful, you will see a ``200 OK'' response:

HTTP/1.0 200 OK
Date: Thu, 17 Jul 2005 16:03:32 GMT
Server: Squid/2.4.1


If the object was not found in the cache, you will see a ``404 Not Found'' response:

HTTP/1.0 404 Not Found
Date: Thu, 17 Jul 2005 16:03:22 GMT
Server: Squid/2.4.1


I hope this will help you.
regards
Hamid Ashraf
compucated(at)msn(dot)com
compucated
Naik
 
Posts: 75
Joined: Mon Oct 13, 2003 5:06 am
WLM: compucated(at)msn(dot)com
Yahoo Messenger: activatedpower(at)yahoo(dot)com
Location: Karachi, Pakistan

Postby asaddotcom » Sat Aug 27, 2005 5:00 pm

Dear compucated
AoA,

Well i dont need to purge anything bcoz i got the solution now :wink:

after to update my web site and put there new images i have to restart my squid service once then i am able to see new images. :lol:

I have try it . and this method is working fine....

Allah Hafiz.

Rgds.

Asad Ali
Last edited by asaddotcom on Sun Aug 28, 2005 3:22 pm, edited 1 time in total.
Thanking You...



ครค๔

www.apnicollection.com | www.wikisoft.pk
asaddotcom
Company Havaldaar Major
 
Posts: 195
Joined: Fri Feb 04, 2005 7:21 pm
ICQ: 172131405
Website: http://www.apnicollection.com
WLM: asaddotcom@msn.com
Yahoo Messenger: asaddotcom2002@yahoo.com
AOL: AsadDotCom
Location: Lahore, PK

Re:

Postby LinuxFreaK » Sun Aug 28, 2005 1:25 am

Dear asaddotcom,
Salam,


Wow what a solution !! But in production Server you can not do this !!

Best Regards.
Farrukh Ahmed
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi

Re:

Postby asaddotcom » Sun Aug 28, 2005 3:23 pm

LinuxFreaK wrote:Dear asaddotcom,
Salam,


Wow what a solution !! But in production Server you can not do this !!

Best Regards.


Dear LF Sallam,

Then you can tell me the more reliable solution :P

Rgds.

Asad Ali
Thanking You...



ครค๔

www.apnicollection.com | www.wikisoft.pk
asaddotcom
Company Havaldaar Major
 
Posts: 195
Joined: Fri Feb 04, 2005 7:21 pm
ICQ: 172131405
Website: http://www.apnicollection.com
WLM: asaddotcom@msn.com
Yahoo Messenger: asaddotcom2002@yahoo.com
AOL: AsadDotCom
Location: Lahore, PK

Re:

Postby kbukhari » Mon Mar 12, 2007 12:24 pm

asaddotcom wrote:
LinuxFreaK wrote:Dear asaddotcom,
Salam,


Wow what a solution !! But in production Server you can not do this !!

Best Regards.


Dear LF Sallam,

Then you can tell me the more reliable solution :P

Rgds.

Asad Ali


use refresh_pattern for .jpg or .whtever
--
Syed Kashif Ali Bukhari
+92-345-8444420
http://sysadminsline.com
http://kashifbukhari.com
kbukhari
Major General
 
Posts: 1222
Joined: Sat Dec 31, 2005 12:29 am
Website: http://kashifbukhari.com
Location: Lahore

Postby asaddotcom » Sat Mar 17, 2007 6:19 am

Dear K.B Sallam,

I want to refresh only those pages who give there "dates", like www.bbcurdu.com. jang.com.pk etc.

how can i set refresh_pattern of it ?

best rgrds.
Asad Ali
Thanking You...



ครค๔

www.apnicollection.com | www.wikisoft.pk
asaddotcom
Company Havaldaar Major
 
Posts: 195
Joined: Fri Feb 04, 2005 7:21 pm
ICQ: 172131405
Website: http://www.apnicollection.com
WLM: asaddotcom@msn.com
Yahoo Messenger: asaddotcom2002@yahoo.com
AOL: AsadDotCom
Location: Lahore, PK

Postby kbukhari » Sat Mar 17, 2007 8:43 pm

asaddotcom wrote:Dear K.B Sallam,

I want to refresh only those pages who give there "dates", like www.bbcurdu.com. jang.com.pk etc.

how can i set refresh_pattern of it ?

best rgrds.
Asad Ali

stop using offline mode ;)
--

Syed Kashif Ali Bukhari

+92-345-8444420

http://sysadminsline.com

http://kashifbukhari.com
kbukhari
Major General
 
Posts: 1222
Joined: Sat Dec 31, 2005 12:29 am
Website: http://kashifbukhari.com
Location: Lahore

Postby asaddotcom » Sat Mar 24, 2007 7:57 am

stop using offline mode ;)


Sallam,

I'm not using offline mode
Thanking You...



ครค๔

www.apnicollection.com | www.wikisoft.pk
asaddotcom
Company Havaldaar Major
 
Posts: 195
Joined: Fri Feb 04, 2005 7:21 pm
ICQ: 172131405
Website: http://www.apnicollection.com
WLM: asaddotcom@msn.com
Yahoo Messenger: asaddotcom2002@yahoo.com
AOL: AsadDotCom
Location: Lahore, PK


Return to “%s” General

Who is online

Users browsing this forum: No registered users and 1 guest

cron