Cloudflare caching works perfectly fine when tested locally but doesn't work when deployed online
I am new to cloudflare. Can't seem to solve the issue with caching, which works perfectly fine on localhost when I test it using the wrangler CLI but as soon as I switch to online testing or deploy to online worker the caching just stops and each subsequent request is loaded as fresh.
To see the worker please visit:
https://shoe-sensation-stg.zmags.workers.dev/?https://staging.shoesensation.com/rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=product_category&searchCriteria[filter_groups][0][filters][0][value]=%25Converse%25&searchCriteria[filter_groups][0][filters][0][condition_type]=like&searchCriteria[page_size]=2&searchCriteria[filter_groups][0][filters][1][field]=season_code&searchCriteria[filter_groups][0][filters][1][value]=BTS23&searchCriteria[filter_groups][0][filters][2][field]=gl_code&searchCriteria[filter_groups][0][filters][2][value]=101
3 Replies
workers.dev does not have cache, you need to link it to a domain.
Cache · Cloudflare Workers docs
The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
Thanks for the update. This helps. much appreciate it.