Cache
A cache is applied between Delog.io and hive to improve loading speed.
Cache application
In the first one, we applied the cache in cloudflare's worker.
It stores in the cache for the api request, and immediately returns the cache contents for the next response.
The problem here is that the worker's cache is cached based on the client browser. This means that caching is stored for each client, and caching data is managed separately for each client.
This will require two refreshes on all clients to see the latest data.
To be improved
By applying a memory-based cache, we plan to have a single cache structure. In this way, after the first update, all clients can receive the latest data.
cloudflare worker cache
I had a lot of trouble applying the cache in cloudflare worker.
In the debugging mode console of the quick edit screen, cache is applied, but undefined is returned.
You need to turn on developer mode in a new tab of your web browser and check the network. If cf cache is displayed as HIT in the response header, the cache has been applied.
You must configure a custom domain rather than a .dev domain, and enable cache storage mode.