How to replace specific objects in squid cache?

General discussion about PLUC and Linux in Pakistan.
Post Reply
asaddotcom
Company Havaldaar Major
Posts: 195
Joined: Fri Feb 04, 2005 7:21 pm
Location: Lahore, PK
Contact:

How to replace specific objects in squid cache?

Post by asaddotcom »

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
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear asaddotcom,
Salam,

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

Best Regards.
Farrukh Ahmed
asaddotcom
Company Havaldaar Major
Posts: 195
Joined: Fri Feb 04, 2005 7:21 pm
Location: Lahore, PK
Contact:

Re:

Post by asaddotcom »

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
compucated
Naik
Posts: 75
Joined: Mon Oct 13, 2003 5:06 am
Location: Karachi, Pakistan
Contact:

Re: How to replace specific objects in squid cache?

Post by compucated »

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/squid24s ... d_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
asaddotcom
Company Havaldaar Major
Posts: 195
Joined: Fri Feb 04, 2005 7:21 pm
Location: Lahore, PK
Contact:

Post by asaddotcom »

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
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear asaddotcom,
Salam,


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

Best Regards.
Farrukh Ahmed
asaddotcom
Company Havaldaar Major
Posts: 195
Joined: Fri Feb 04, 2005 7:21 pm
Location: Lahore, PK
Contact:

Re:

Post by asaddotcom »

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
kbukhari
Major General
Posts: 1222
Joined: Sat Dec 31, 2005 12:29 am
Location: Lahore
Contact:

Re:

Post by kbukhari »

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
asaddotcom
Company Havaldaar Major
Posts: 195
Joined: Fri Feb 04, 2005 7:21 pm
Location: Lahore, PK
Contact:

Post by asaddotcom »

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
kbukhari
Major General
Posts: 1222
Joined: Sat Dec 31, 2005 12:29 am
Location: Lahore
Contact:

Post by kbukhari »

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
asaddotcom
Company Havaldaar Major
Posts: 195
Joined: Fri Feb 04, 2005 7:21 pm
Location: Lahore, PK
Contact:

Post by asaddotcom »

stop using offline mode ;)
Sallam,

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

ครค๔
www.apnicollection.com | www.wikisoft.pk
Post Reply