0

Goal: for the pattern given, cache the response for a given time, no matter what.

So far my squid.conf looks like this:

refresh_pattern -i \.git/info/refs 3600 100% 3600 ignore-reload ignore-no-store ignore-private override-expire override-lastmod

However, the freshness is still validated on every request:

1665672549.558    236 10.0.2.100 TCP_REFRESH_MODIFIED/200 771 GET https://github.com/appuio/component-openshift4-version.git/info/refs? - HIER_DIRECT/140.82.121.3 application/x-git-upload-pack-advertisement
1665672549.966    155 10.0.2.100 TCP_REFRESH_MODIFIED/200 782 GET https://github.com/appuio/component-openshift4-version.git/info/refs? - HIER_DIRECT/140.82.121.3 application/x-git-upload-pack-advertisement
1665673113.935    149 10.0.2.100 TCP_REFRESH_MODIFIED/200 783 GET https://github.com/appuio/component-openshift4-version.git/info/refs? - HIER_DIRECT/140.82.121.4 application/x-git-upload-pack-advertisement
1665673114.614    442 10.0.2.100 TCP_REFRESH_MODIFIED/200 777 GET https://github.com/appuio/component-openshift4-version.git/info/refs? - HIER_DIRECT/140.82.121.4 application/x-git-upload-pack-advertisement

How can I enforce squid to cache this URL for an hour?

mhutter
  • 111
  • 4
  • the question mark is the problem ;) but in second do you intercept ssl? – djdomi Oct 13 '22 at 17:55
  • I saw the question mark, but I don't anchor the regex (no `$`), so why does it matter? Yes, I do SSL bumping – mhutter Oct 14 '22 at 05:27
  • because the question mark, marks the content to not static. I had to figure it out on my own. moreover I got the hint from the [squid manual](https://wiki.squid-cache.org/ConfigExamples/DynamicContent/Coordinator) additionally – djdomi Oct 16 '22 at 17:26
  • If you place the new refresh_pattern _before_ the pattern that addresses the question mark (`refresh_pattern -i (/cgi-bin/|\?)`) then your pattern should work, provided that the server is not supplying a header that says that the content is not cache-able. If the server has marked it as not being cache-able then you will need to turn on some `debug_options` to look at the HTTP headers and see what's up. – Compholio Dec 02 '22 at 16:32

0 Answers0