Avoiding waterfalls
I've got a website on pages. It has some backend logic, and also calls an api. The api is hosted on workers.
From what I understand, the cold start for the website should be very minimal because it's warmed during https handshake. That request alone is around 300ms, which is ok.
The website then needs to call the api. Again, this has around 300ms warm up. Now the total for the request to the website ends up around a full second. That's way too long. If I could pre-warm the api when warming pages, I think I can save at least 300ms.
How do I avoid waterfalls?
3 Replies
Couple things to look into:
* 304 status, ETAG/If-None-Match headers for client side caching.
* Leverage CF cache API for server side caching
DEV Community
Web Caching - ETag/If-None-Match
Support code In the previous post, we explored the usefulness of the Last-Modified Response Header...
Cloudflare Docs
Cache | Cloudflare Workers docs
Control reading and writing from the Cloudflare global network cache.