Caching +page.svelte on Cloudflare #10966
-
Hello! How can I cache pages on Sveltekit when using Cloudflare pages? I assumed static pages or pre-rendered pages would automatically be cached with Cloudflare but I am seeing I have seen some suggestions to create a Cloudflare cache rule that targets load functions by looking for “__data.json” but I was hoping to cache the actual +page.svelte (html) and not the load function. I’m not currently setting any cookies but I've seen issues when setting cookies with Cloudflare's cache, is it possible to set a cookie and still get cached pages? Live example: https://demo.tripcafe.org/ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You have a few different options to customise Cloudflare to cache your HTML files. |
Beta Was this translation helpful? Give feedback.
You have a few different options to customise Cloudflare to cache your HTML files.
https://developers.cloudflare.com/cache/concepts/default-cache-behavior/#customization-options-and-limits