I'll describe my case:

I have an aws lambda that will expose an API interface that will return json data (by topic) which is cached. This lambda will also offer private endpoints to recalculate the public data, then clear cache (by topic) and return data from new.

On event based system these private endpoints will be invoked. So no control over them and recalculate means computation time.

So the idea is to implement a debounce/buffer. In order not to fire immediately on every request the clear cache/computaiton, but to store the request on a buffer then, on a certain time window, maybe with a scheduled lambda, check the buffer and fire an optimized cache bust.

What can be the right driver?

(light & easy to implement, since it would be just to store a bunch of lines that might be wiped out every five minutes, and store very simple data like datetimeRequest+topic ) in order to store these latest request and then on a certain frequency get this buffer and invoke uniquely (by topic) the cache buster?

  • A straightforward way to deal with cache invalidation is to keep track of when the cache was last refreshed and when you receive a request that is after the cache period, you refresh it. I'm struggling to see how this is functionally different from what you are describing. Can you clarify?
    – JimmyJames
    Sep 3, 2020 at 18:32
  • What u describe makes sense when fresh datacan be served on acceptable latency. Otherwise cache refresh needs to be managed separately like backend timed processing
    – koalaok
    Sep 3, 2020 at 20:22
  • "tun clear cache" is this a typo or are you about to teach me a new way to clear cache? Sep 4, 2020 at 4:18


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.