cloudflare cache on workers

in #cloudflare2 years ago (edited)

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.

Sort:  

I really appreciate your efforts in this and keep up the good work progressing.

thank you 🙏 for always good comment

Wow...
Work in progress 👍
Weldon 👌

good good it will be more good 😊

You are making head way already. Good you overcame the trouble.

Great job.

thank you for your comment 😊

The pleasure is mine

Anything that implies improvement is welcome, thank you for your work.

delog.io will be a meaningful web3 blog service😊

Wow I must confess this a good development. May the Lord help you to make the final point a reality.

thank you for your comment ☺️