question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feature request: cache override/force

See original GitHub issue

It’d be useful to have an option on making a request to clear the existing cache for the id. This is because knowing the id of a request to invalidate it can be difficult.

The workaround I might use for now is to use the built in id generator and calculate the expected id from it, but it adds a lot of complexity.

I see this being implemented as:

  1. calculate id using the key generator
  2. calling await axios.storage.remove(id)
  3. running the request

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
arthurfiorettecommented, Jun 11, 2022

Hey @domdomegg, I’ve just released 0.10.5!

1reaction
domdomeggcommented, Jun 10, 2022

Hey @arthurfiorette, the override option you’ve implemented exactly what I wanted I think - thanks 🙌

I agree that centralizing all request functions might go some way to alleviating this problem. However, in our app doing that would add quite a bit of boilerplate to an app that already strictly types its APIs using some existing wrappers. And yes, those wrappers could also generate unique ids for each endpoint and make sure it’s applying them correctly when calling with different arguments/params etc. (I think the same might go for a file which externalizes and centralizes the right ids dependent on params etc.), but at least in our codebase that would be significantly more complex than being able to override the cache when making certain requests we know shouldn’t use the cache anyways.

Again, thanks for the amazingly fast response - this feature really helps us 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Request.cache - Web APIs | MDN
It controls how the request will interact with the browser's HTTP cache. Value. A RequestCache value. The available values are: default — The ......
Read more >
requests-cache 0.9.7 documentation
requests -cache is a transparent, persistent cache that provides an easy way to get better performance with the python requests library.
Read more >
A Caching Structure! - NI Community - National Instruments
I propose an simple Caching Structure as show on the right that retains that same functionality with less baggage.
Read more >
Feature request: Client Caching · Issue #861 · RicoSuter/NSwag
It will be super cool to have a client caching which is created based on some sort of attribute in the web api...
Read more >
Cache | Elf | A Reactive Store with Magical Powers
npm i @ngneat/elf-requests. To use this feature, provide the withRequestsCache props factory function in the createStore call: todos.repository.ts.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found