[squid-users] refresh_pattern and same objects

Amos Jeffries squid3 at treenet.co.nz
Tue Sep 1 11:46:27 UTC 2015


On 1/09/2015 9:32 p.m., FredB wrote:
> 
>>>
>>> refresh_pattern -i \.(htm|html|xml|css)(\?.*)?$ 43200 1000% 43200
>>> -> This is my previous rule "http"
>>
>> Yes.
>>
>> Oh, and there is the less common .chm could be in that set too.
>>
> 
> 
> Ok added 
> 
> A last point there is a real difference between (\?.*)?$ and (?.*)?$ Here http://www.squid-cache.org/mail-archive/squid-users/201012/0002.html your advice was refresh_pattern -i \.(a|b|c|d)(?.*)?$  
> 

Yes there is. The version without '\' was a mistake causing invalid regex.

'?' is a reserved operator in regex. The intention is to match the
query-string starting with a '?' character. So the first one needs to be
escaped to become an exact-match. The second un-escaped to make the part
inside the brackets optional.

Amos



More information about the squid-users mailing list