[squid-users] squid-users Digest, Vol 29, Issue 21
Amos Jeffries
squid3 at treenet.co.nz
Fri Jan 13 05:37:30 UTC 2017
On 13/01/2017 4:54 a.m., Vidyadhish Joshi wrote:
> Hi Amos,
>
> I appreciate your effort in answering the queries .
> Thank you Amos for resolving most of my queries since from last week.
>
> Sorry to disturb you again. I am facing an issue in my application.
>
> The Squid is caching the contents and getting TCP_HIT and TCP_MEM_HIT in
> access logs. If i keep the browser idle for 10 min and later if i try to
> navigate to same tabs in application which were cached earlier, then
> instead of serving from cache its taking more time to load nearly 10 to 15
> seconds and again hitting the server again.
>
> I have default squid cache with refresh pattern for my application URL
> cached for one day i.e 1440 i.e
>
> refresh_pattern ^http://*.applicationurl.net.*/.* 1440 100% 4320
>
The regex on that line is not correct.
The "http://*." part requires 0 or more '/' characters before the
"application.net" domain name. It *does not* match sub-domain segments.
Also Squid does not need a trailing .* pattern, that is implicit.
I think the pattern you were trying to achieve is:
^http://(.*\.)?applicationurl\.net(\..*)?/
Also be aware that refresh_pattern does not force those parameters on
any URL. It is simpy providing default values *if* (and only if) the
response for matching URLs does not contain the relevant Cache-Control
settings.
If the server provides caching values, those will be used instead.
> Is there a way to overcome this issue? Did you face this issue in web
> application ?
>
There does not appear to be any issue in the caching. Dynamic content
can have very short storage times. That is why it is called dynamic.
>From your description it sounds like the application updates its content
more often than each 10mins.
Take the URL from your access.log and paste it into the tool at
http://redbot.org. It will tell what cacheability behaviour is expected.
The 10-15 second delay is not something Squid can do much about, if the
server takes that long to generate a reply thats what it takes.
Amos
More information about the squid-users
mailing list