LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-29-2009, 05:37 AM   #1
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Rep: Reputation: 51
squid 3 -> exclude URL from caching


hi

I have Squid Version 3.0 PRE5 installed on debian etch.
Howto exclude some URL from the proxy caching at squid.conf ?

Last edited by cccc; 06-23-2009 at 07:41 PM.
 
Old 01-31-2009, 12:19 PM   #2
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 51
I've added in squid.conf the following entries:
Code:
acl url dstdomain .mydomain.com
always_direct allow url
cache deny url
and hope is OK now.

Last edited by cccc; 02-09-2009 at 12:14 PM.
 
Old 02-09-2009, 12:14 PM   #3
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 51
???

Last edited by cccc; 06-17-2009 at 07:52 AM.
 
Old 06-17-2009, 07:54 AM   #4
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 51
Knows someone if I use
Code:
allow direct
for an URL in /etc/squid/squid.conf, do I need also an additional entry
Code:
cache deny
to exclude some domains from the proxy caching?

Last edited by cccc; 06-23-2009 at 07:42 PM.
 
Old 06-18-2009, 10:55 AM   #5
pliqui
Member
 
Registered: Feb 2007
Location: Caracas, Venezuela
Distribution: Debian x64
Posts: 156

Rep: Reputation: 17
If i understand well you want to block a website, right?

you can create a file like bad-sites.acl where you will add all the sites or words (like sex) you want to block
Code:
intranet:/etc/squid3# cat bad-sites.acl
.meebo.com
.playboy.com
then add this line to your squid.conf

Code:
acl bad_url url_regex "/etc/squid3/bad-sites.acl"
http_access deny bad_url
 
Old 06-18-2009, 01:53 PM   #6
okcomputer44
Member
 
Registered: Jun 2008
Location: /home/laz
Distribution: CentOS/Debian
Posts: 246

Rep: Reputation: 53
Quote:
Originally Posted by pliqui View Post
If i understand well you want to block a website, right?

you can create a file like bad-sites.acl where you will add all the sites or words (like sex) you want to block
Code:
intranet:/etc/squid3# cat bad-sites.acl
.meebo.com
.playboy.com
then add this line to your squid.conf

Code:
acl bad_url url_regex "/etc/squid3/bad-sites.acl"
http_access deny bad_url
No he does not.

He wants to disable the caching function.

Modify the squid configuration to this:

#no local caching
maximum_object_size 0 KB
minimum_object_size 0 KB

# specify uncachable requests
acl all src 0.0.0.0/0.0.0.0
no_cache deny all

# avoid having a cache directory
cache_dir null /tmp
or
cache_dir null /null

Laz
 
Old 06-23-2009, 07:43 PM   #7
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 51
thx, but I'd like to exclude from the proxy caching just for some domains and not disable proxy caching generally.
 
Old 08-27-2009, 08:57 PM   #8
Taleya
LQ Newbie
 
Registered: May 2007
Posts: 8

Rep: Reputation: 0
I have a similar question - forgive me, my brain is completely blown atm, and I can't play about with the production server right now :P

Basically just want to exclude a particular part of a website from caching - I don't want to block the entire domain due to massive data issues, just one subdir (basically: staff bitching about PDFs)

acl NonCaching url_regex ^http://mydomain/subdir/downloads/$

Should work, yes?
 
Old 08-27-2009, 09:45 PM   #9
pliqui
Member
 
Registered: Feb 2007
Location: Caracas, Venezuela
Distribution: Debian x64
Posts: 156

Rep: Reputation: 17
You need to watch your regex syntax, need to scape the / characters, a quick google and found this thread, hopes it helps

http://www.mail-archive.com/squid-us.../msg16564.html

Remember to back your squid.conf if you are changing it in your production environment and more if you are tired.

Code:
cat squid.conf > squid.conf.bak
Cya
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
caching download with squid yawe_frek Linux - Software 2 10-20-2007 06:15 PM
proxy caching(squid) nics Linux - Software 8 05-23-2007 10:25 AM
caching with squid kernelvn Linux - Networking 2 07-17-2005 11:54 PM
exclude whole webseite from proxy caching cccc Linux - Networking 0 07-21-2004 05:13 PM
how to do caching on squid? gigi Linux - Software 2 02-23-2004 10:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration