Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Squid cache_object:// URI scheme is deprecated #100

Open
dswarbrick opened this issue Sep 17, 2024 · 1 comment · May be fixed by #102
Open

Squid cache_object:// URI scheme is deprecated #100

dswarbrick opened this issue Sep 17, 2024 · 1 comment · May be fixed by #102

Comments

@dswarbrick
Copy link
Contributor

According to Squid documentation, the cache_object:// URI scheme is deprecated.

Squid 6.3 accidentally removed support for legacy cache_object URLs, but Squid 6.4 reinstated support for them (squid-cache/squid#1475), at least for now. Support for the legacy cache_object URLs is slated for final removal in Squid 7.

The modern method of fetching this information is using the squid-internal-mgr URLs with a standard HTTP client. For example, it can be accessed simply with curl (i.e. instead of the legacy / deprecated squidclient tool) as:

curl http://localhost:3128/squid-internal-mgr/counters

Squid has supported this method since version 3.2.0.10, released in July 2011.

Support for the legacy cache_object URLs has already been removed from Squid's master branch, and will thus be absent when Squid 7 is released.

To support Squid 7 and later, squid-exporter needs to implement support for the squid-internal-mgr endpoint via HTTP(S). Since this method has been supported by Squid for well over ten years, I also suggest that it is time for squid-exporter to remove support for the legacy cache_object:// method.

@dswarbrick
Copy link
Contributor Author

Just for the record, I was planning to refactor squid-exporter's cache_object get() function using a custom HTTP RoundTripper. The reason for needing a custom RoundTripper is that the cache_object:// URI is not RFC-3986 compliant, and is thus rejected by Go's default HTTP transport.

I did get 90% of the way there, but things started to get fiddly with refactoring the client test to use a httptest server (which also would have required a custom RoundTripper to accept the non-compliant cache_object:// URI in the GET request). Given that this legacy code just needs to die, I decided to stop wasting my time on that effort.

I am happy to provide a PR which will drop support for the legacy cache_object:// URI and instead implement support for the squid-internal-mgr style endpoint. Such a PR would likely obsolete a couple of outstanding PRs, and might also inadvertently fix a couple of outstanding issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant