usage of etag

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

usage of etag

fansari
Assuming my web application sends headers with information like this:

Cache-Control: public, max-age=0
Last-Modified: Thu, 22 Aug 2019 08:50:29 GMT
ETag: W/"ed52a4-16cb8852696"

Now I was under the impression I could do something like this with curl:

ETAG='ed52a4-16cb8852696'
curl --head --header 'if-none-match: W/'\"${ETAG}\" --cacert ${CERT} --proxy
${PROXY} --proxy-insecure --insecure ${URL}

and then set ETAG either to the real ETag (then I would expect a HIT) or to
some other value (then I would expect a MISS and the content reloaded again
from the internet).

Nevertheless when I run curl with wrong etag I get HITs.

Does squid not work this way or have I to configure something special?




--
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: usage of etag

fansari
Problem was the --head option.

For real downloading it works.

ETAG='ed52a4-16cb8852696'
curl --header 'if-none-match: W/'\"${ETAG}\" --cacert ${CERT} --proxy
${PROXY} --proxy-insecure --insecure ${URL} > ${FILE}

With correct ETag the download is an emtpy file (TCP_INM_HIT/304).

With incorrect ETag the content is downloaded into the file
(TCP_MEM_HIT/200).




--
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