mmd123 / squid-cache-dynamic_refresh-list

list of dynamic_refresh patterns to use with squid3, I had a hard time finding things online, so I figured I'd make a collaborative github repo for just this purpose
8 stars 4 forks source link

Dealing with TCP_MISS/302 redirects #18

Open ageekhere opened 2 months ago

ageekhere commented 2 months ago

Has anyone been successful with caching content from sites that use 302 redirects? Lets use this example link https://github.com/microsoft/winget-cli/releases/download/v1.9.1792-preview/DesktopAppInstallerPolicies.zip

Lets assume that the default is to splice all and only bump sites that we set. If we bump objects.githubusercontent.com We get TCP_MISS/200, and it cannot cache the zip
TCP_MISS/200 | https://objects.githubusercontent.com/github-production-release-asset-2e65be/197275130/c65ea7bb-d1af-47c8-9b4d-b5cf49b8723c?

If we also bump github.com we now get TCP_MISS/302 https://github.com/microsoft/winget-cli/releases/download/v1.8.1791/DesktopAppInstallerPolicies.zip TCP_MISS/302 is a Redirect which also not cannot be cached.

Some things i have tried is creating a new Refresh pattern for github without successes refresh_pattern -i \.github\.com/.*\.(exe|zip|tar.gz)$ 1440 100% 1440

Maybe a helper file is needed, i am not sure atm.

I am also not sure if bumping all of github.com can lead to connection issues.

Update 1. have also tried

refresh_pattern -i \.githubusercontent\.com/.* 1440 100% 1440
refresh_pattern -i \.githubusercontent\.com/.*\.(exe|zip|tar\.gz)$ 1440 100% 1440
refresh_pattern -i \.objects\.githubusercontent\.com/.*\.(exe|zip|tar\.gz)$ 1440 100% 1440

testing with bump all on download link https://github.com/HandBrake/HandBrake/releases/download/1.8.1/HandBrake-1.8.1-arm64-Win_GUI.exe results are

TCP_MISS/200    https://objects.githubusercontent.com/github-production-release-asset-2e65be/41215835/5da2c409-a52e-459d-adf0-6e86dd3861b0? 
TCP_MISS/302    https://github.com/HandBrake/HandBrake/releases/download/1.8.1/HandBrake-1.8.1-arm64-Win_GUI.exe