Open Leftium opened 1 year ago
Is there any workaround available for this? I am programming an events view widget which relies on data of a public google calendar. It would be great to be able to easily cache calls to the Rest API of Google Calender, without having to rely on external caching solutions like Redis.
Is there any workaround available for this?
I have implemented something using Vercel ISR. The important bits of code are here:
GET()
return statementHEAD()
I haven't implemented an interface/API for cache-busting/bypass yet, but you just need to send a header with bypassToken
.
If you don't need cache invalidation, you might be able to just use cache control headers
Limitations:
config
(you can create multiple endpoints with different periods). fetch()
wrapper: must create +server endpoint for each API you want to cache.Does Vercel document how a framework other than Next.js would implement Data Cache?
@Leftium One difference between ISR caching and Vercel data cache is that the later is persisted across deployments which you can't really workaround with your implementation. The only workaround I can think of is to manually use Vercel KV to implement a data cache.
Describe the problem
It would be nice if SvelteKit supported Vercel Data Cache.
Data Cache increases web site performance and reduces (external) API usage via
fetch()
. It is similar to, but different than ISR and Edge Cache (cache control headers).This feature would probably be specific to the
vercel-adapter
, but bonus points for making it platform-agnostic.My specific use case:
Describe the proposed solution
fetch()
request headers.Alternatives considered
vercel-adapter
ISRImportance
would make my life easier
Additional Information
No response