Score:0

Squid refreshing freshness even with `override-expire`

ru flag

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?

djdomi avatar
za flag
the question mark is the problem ;) but in second do you intercept ssl?
mhutter avatar
ru flag
I saw the question mark, but I don't anchor the regex (no `$`), so why does it matter? Yes, I do SSL bumping
djdomi avatar
za flag
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
ro flag
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.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.