How to execute some code before the worker goes cold

For Workers & Pages, what is the name of the domain?

What is the issue or error you’re encountering

I am caching some global variables in memory. Before the worker spins down, I want to flush them into a persistant storage like kv cache or redis. How can I execute a piece of code just before worker is scheduled to go cold?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.