Need an http proxy that can set custom cache keys

I need to configure an http proxy that can set its own cache key for the returned content. It seems that squid2.7 might have been able to do this using the storeurl_rewrite_program function, however this function has not yet been ported to squid3. Is there any other way to do this using squid or other http proxy software? If this software can also interact with external servers for access control to cache objects that are a bonus, but this is not immediately necessary.

A use case is that I want to cache frequently used data for quick access due to slow storage. This storage is accessed by HTTP to an interface that always returns a 302 redirect (temporary move) to one of the backup disks on which the data is actually stored. The data files I want to cache are publicly available, static, and typically several gigabytes in size, and are therefore ideal for caching. However, the redirect URLs will contain authentication tokens and therefore will always be unique, effectively denying the cache. On the other hand, it is trivial to restore the original URLs from the redirect URLs, so if the proxy server can do this and use it for cache keys, then the cache returns to the business.

Getting storeurl_rewrite_program in squid3 is flagged important here:

http://wiki.squid-cache.org/RoadMap/Squid3

but it is extremely unclear whether this will turn it into squid3.3 or even squid3.4, and squid2.7 is planned to be destroyed by the release of squid3.2.

As for access control, it seems that squid should be able to do this using the external_acl_type function, but providing cached access to protected data at this stage is not so important, so at the moment I think it's just sugar on top.

+4
source share

Source: https://habr.com/ru/post/1411714/


All Articles