gyemo
gyemo
CDCloudflare Developers
Created by gyemo on 4/6/2025 in #workers-help
cannot access cached pages created by worker
Hi. Beginner programmer here, using lots of help from AI. On free cloudflare plan. I am trying to fetch some data, do some math on it and create a page with the data. I expect the data to be cached for a full day instead of fetching and creating a new page on each request. I succesfully created an HTTP endpoint which can read the previously stored data (in KV), create the webpage and cache it. I can then access the page from my browser. This is all good. My problem is I want this to happen on a schedule. I created the scheduler, which successfully runs. fetches and stores the data. Here is where my problems start. From this scheduler I fetch the http endpoint mentioned earlier, which should trigger the creation of the website and caching. According to the logs I am succesfully doing this but when I try to access the cached page from my local browser i get a cache not found. I have already attempted doing this by triggering the http endpoint. I have also done it using internal function calls and finally with lots of AI help i changed it to do the same with RPC. In all three methods I theoretically am creating the page and caching it with no logged errors, but when I try to access it with my browser i cannot find the page. (as i mentioned earlier, if I trigger the http endpoint from my browser, then it does work). What am I missing? Could it be that when the worker caches the page it is cached in a zone different than the one my browser accesses? If yes, how do i solve this? What other things should I check? thank you!
5 replies