[Feature Request] allow supplying a different cache key derivation function for urls
See original GitHub issuei can understand why okhttp3.Cache
is made final as mentioned in https://github.com/square/okhttp/issues/2740 , also mentioned in https://github.com/square/okhttp/issues/1459 , https://github.com/square/okhttp/issues/2261 , but i think a small change can be made to greatly increase flexibility, without changing it’s final
status
that is, allow providing a different key
implementation, currently it’s just a one-liner that converts a url to a string: https://github.com/square/okhttp/blob/fb284d35083e466c435565b9a1ee4092e322cc83/okhttp/src/main/java/okhttp3/Cache.java#L186
i believe adding a option to change it is easy, possibly using the builder pattern, and won’t require change to any other components
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Manipulating the cache key | Fastly Help Guides
You can set the cache key explicitly (including attaching conditions) by adding a request setting via the Settings page in the configuration ...
Read more >Shedding Light on Samsung's TrustZone Keymaster Design
The Android application requests a new key to be gen- erated. The Keymaster TA generates a new key, and encrypts it using a...
Read more >Chapter 5. Authentication and Interoperability Red Hat ...
New Kerberos credential cache type: KCM. This update adds a new SSSD service named kcm . The service is included in the sssd-kcm...
Read more >DASH-IF implementation guidelines: content protection and ...
A DRM system cooperates with the device's media platform to enable playback of encrypted content while protecting the decrypted samples and ...
Read more >Enable Enhanced Domains - Salesforce Help
To update your Salesforce org's URLs to the latest standards, enable and deploy enhanced domains. With enhanced domains, all URLs across your org...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That is strange, how does it work with browsers where caches aren’t configurable?
The URL is a really awesome cache key, and URLs should be designed with caching in mind. You should use path & query for data that impacts caching (userId), and headers for things that don’t (signature).
If your server developers didn’t do this, they should! It’ll improve caching on every HTTP client.
Won’t fix.