But this only assets files got cached, I’m wondering if there is a way to cache the web page(HTML markup) it self ? For example caching the response for https://example.com/foo/bar ( content-type: text/html; charset=utf-8)
I have another question which is related to this topic,
I was reading this article
and I just thought it must going to use the worker’s KV to “save” and “get” the cache(via a cache key), but I can’t find any related code for saving and retrieving cache from the article, so, is worker going to cache by default when using the fetch API… ?
Yes, normal behaviour as if it was passing through Cloudflare or following their cache-control headers if not in your domain, with the usual caveats that it might be evicted at need.
In a Worker you have the Cache API, and KV. You can take advantage of both.