Reputation: 347
I want to setup Squid to cache specific files (.jpeg) from a specific domain. These files are updated daily. I'm running Ubuntu. I have a script on my laptop that makes use of these files and ideally I would like this script to make calls to the Squid cache instead of directly to the server. I don't want to cache content that is not from the domain and is not of the correct file type. Is this possible, and what do I need to edit in squid.conf
?
Upvotes: 4
Views: 5714
Reputation: 61
The proposed solution:
acl filecachetype urlpath_regex \.jpeg
acl cacheDomain dstdomain <your domainname> or acl cacheDomain dst <domain ip>
cache deny !filecachetype !cacheDomain
Will not work. ACLs do AND on the same like so it means that it will only avoid caching when a file is both non-jpeg and not on domain.com. It will still cache:
What you need is:
acl filecachetype urlpath_regex \.jpeg
acl cacheDomain dstdomain <your domainname>
cache deny !filecachetype
cache deny !cacheDomain
This will deny caching files that are not jpeg (no matter where they are, even on your server) and also will deny caching files not on <your domain> (even if they are jpeg). Logical OR, instead of AND.
Upvotes: 3
Reputation: 447
acl filecachetype urlpath_regex \.jpeg
acl cacheDomain dstdomain <your domainname> or acl cacheDomain dst <domain ip>
cache deny !filecachetype !cacheDomain
cache all
Upvotes: 1