Question about refresh_pattern and access time...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about refresh_pattern and access time...

EdouardM
Hi All,
question i have in mind about the refresh_pattern and multi-access...
let say i use a refresh_pattern about 1 month with an already cached object,
the question is:
- scenario 1: whatever the number of times the object will be requested,
once the delay (1 month) is expired the Squid will download a fresh copy
from internet ?
- scenario 2: each time the object is requested the ending-date will be
re-calculated for +1 month ?

in both scenarii, the remote object never changes...
from your point of view, what's the correct scenario here ?

thanks guys

bye Ed.



--
Sent from: http://squid-web-proxy-cache.1019090.n4.nabble.com/Squid-Users-f1019091.html
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Question about refresh_pattern and access time...

Amos Jeffries
Administrator
On 12/10/17 04:57, EdouardM wrote:

> Hi All,
> question i have in mind about the refresh_pattern and multi-access...
> let say i use a refresh_pattern about 1 month with an already cached object,
> the question is:
> - scenario 1: whatever the number of times the object will be requested,
> once the delay (1 month) is expired the Squid will download a fresh copy
> from internet ?
> - scenario 2: each time the object is requested the ending-date will be
> re-calculated for +1 month ?
>
> in both scenarii, the remote object never changes...
> from your point of view, what's the correct scenario here ?

Neither of those.

HTTP defines an algorithm for calculating object freshness.
<https://tools.ietf.org/html/rfc7234#section-4.2>

What refresh_pattern does is provide default values for the
section-4.2.2 parameters *if* the server does not deliver the values itself.

The most recent releases of Squid can also infer Date or Last-Modified
from message arrival times for the age calculation algorithm.

Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Question about refresh_pattern and access time...

EdouardM
Amos,
here is an example:
http://au.download.windowsupdate.com/d/msdownload/update/software/updt/2017/09/windows10.0-kb4023814-x86_f07f9708c76807b1b19545521f17d6e2fefdd627.cab
  HTTP/1.1 200 OK
  Cache-Control: public,max-age=172800
  Content-Length: 6150968
  Content-Type: application/vnd.ms-cab-compressed
  Last-Modified: Wed, 27 Sep 2017 21:16:36 GMT
  Accept-Ranges: bytes
  ETag: "09295e6d537d31:0"
  Server: Microsoft-IIS/8.5
  X-Powered-By: ASP.NET
  X-CID: 7
  X-CCC: IN
  X-MSEdge-Ref: Ref A: 7A93444FAE0B4491BE72E049496DEC25 Ref B: BOM02EDGE0119
Ref C: 2017-10-12T06:36:40Z
  X-MSEdge-Ref-OriginShield: Ref A: C8FD899B17694B8AA6641257C2636B9B Ref B:
BOM01EDGE0318 Ref C: 2017-10-11T14:02:56Z
  Date: Thu, 12 Oct 2017 06:36:40 GMT
Length: 6150968 (5.9M) [application/vnd.ms-cab-compressed]

does it mean the object will be valid for 2 days (max-age=172800) only, then
the Squid will download a fresh copy from internet even if we set the
refresh_pattern to 1 month ?

Ed.



--
Sent from: http://squid-web-proxy-cache.1019090.n4.nabble.com/Squid-Users-f1019091.html
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Question about refresh_pattern and access time...

Amos Jeffries
Administrator
On 12/10/17 19:43, EdouardM wrote:

> Amos,
> here is an example:
> http://au.download.windowsupdate.com/d/msdownload/update/software/updt/2017/09/windows10.0-kb4023814-x86_f07f9708c76807b1b19545521f17d6e2fefdd627.cab
>    HTTP/1.1 200 OK
>    Cache-Control: public,max-age=172800
>    Content-Length: 6150968
>    Content-Type: application/vnd.ms-cab-compressed
>    Last-Modified: Wed, 27 Sep 2017 21:16:36 GMT
>    Accept-Ranges: bytes
>    ETag: "09295e6d537d31:0"
>    Server: Microsoft-IIS/8.5
>    X-Powered-By: ASP.NET
>    X-CID: 7
>    X-CCC: IN
>    X-MSEdge-Ref: Ref A: 7A93444FAE0B4491BE72E049496DEC25 Ref B: BOM02EDGE0119
> Ref C: 2017-10-12T06:36:40Z
>    X-MSEdge-Ref-OriginShield: Ref A: C8FD899B17694B8AA6641257C2636B9B Ref B:
> BOM01EDGE0318 Ref C: 2017-10-11T14:02:56Z
>    Date: Thu, 12 Oct 2017 06:36:40 GMT
> Length: 6150968 (5.9M) [application/vnd.ms-cab-compressed]
>
> does it mean the object will be valid for 2 days (max-age=172800) only, then
> the Squid will download a fresh copy from internet even if we set the
> refresh_pattern to 1 month ?

CC:max-age=172800 means it can be served unconditionally from cache for
172800 seconds from Date: Thu, 12 Oct 2017 06:36:40 GMT.

After Sat, 14 Oct 2017 06:36:40 GMT (Date + CC:max-age) it is stale and
needs revalidating before any use. The headers from the revalidation
response will alter the above headers to provide new values for Date and
maybe other bits.

Altering Date naturally alters the base time for the max-age freshness
calculation. So it should be served unconditionally for the next 48hrs
from time of revalidation. Rinse and repeat. **

refresh_pattern is irrelevant here because all the necessary algorithm
parameters for exact expiry (Date and CC:max-age) are provided by that
server.


** NP: that is what should happen anyway, modulo bugs in Squid
calculations or admin configuration settings to force other behaviour.

Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users