© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•16mo ago•
5 replies
nj

Cache API usage in worker to cache POST requests.

Hey I wanted to cache POST requests to one of my APIs and I seem to be stuck with CacheAPI. That's the code: https://anonpaste.io/share/29c8fc4d04 (sorry for link but there is char limit of 2000).

I'm never getting anything out of cache, despite the cache.put being ok. As you can see that cache CHANGES the original URL so kinda tries to act like a caching proxy for POST urls.

What am I doing wrong here?
AnonPaste - Share Text, Images, and Files Anonymously
export default {
async fetch(request, env, ctx) {
async function sha256(message) {
// encode a
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Using cache in worker
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Caching R2 using worker cache api
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Caching worker responses in Tiered Caching with Fetch API, similar to Cache API.
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
11mo ago