Search squid archive

Re: filesize acl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mike Leong wrote:
hi

is it possible to tell squid to cache certain type of types based on filesize?

eg: only cache jpegs greater than 2K; but for other images, don't care about filesize.

the closest thing I can find is the minimum_object_size directive, but that covers everthing..


mike
Given the disclaimer at http://www.squid-cache.org/mail-archive/squid-users/200603/0022.html and assuming it works like http_access rules (all ACLs are "AND-ed" together), I would think you could use use the no_cache directive. Something like...

acl greater_than_2K rep_header Content-Length [3-9][0-9]{0,3} # Match a size of 3000 through infinity
acl jpeg rep_mime_type image/jpeg
no_cache deny jpeg !greater_than_2K # Don't cache JPEGs unless they are reported greater than 2999 bytes in size

...should prevent caching small JPEGs from servers that correctly identify both the content type, and size of said images, though I think it would also prevent the caching of JPEGs that have no reported size. *shrug*

Chris

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux