Squid only caches content for a specific domain and file type.

I want to configure Squid to cache specific files (.jpeg) from a specific domain. These files are updated daily. I am running Ubuntu. I have a script on my laptop that uses these files, and ideally I would like this script to make calls to the Squid cache and not directly to the server. I do not want to cache content that does not belong to the domain and does not match the correct file type. Is this possible, and what do I need to change in squid.conf?

+4
source share
2 answers

Proposed Solution:

acl filecachetype urlpath_regex \.jpeg
acl cacheDomain dstdomain <your domainname> or acl cacheDomain dst <domain ip>
cache deny !filecachetype !cacheDomain 

. ACL , , , , jpeg, domain.com. :

  • < >
  • jpeg

:

acl filecachetype urlpath_regex \.jpeg
acl cacheDomain dstdomain <your domainname>
cache deny !filecachetype
cache deny !cacheDomain

, jpeg ( , , ), < > ( jpeg). , AND.

+3
acl filecachetype urlpath_regex \.jpeg
acl cacheDomain dstdomain <your domainname> or acl cacheDomain dst <domain ip>
cache deny !filecachetype !cacheDomain 
cache all
+1

Source: https://habr.com/ru/post/1613084/


All Articles