Menu, but better
This is a Next.js project bootstrapped with create-next-app
, and deployed on Vercel.
It uses shadowwalker/next-pwa
for two purposes:
- Add to home screen in iOS (only works in Safari)
- Offline availability (there might still be a delay unless you turn on airplane mode)
Clone the repository and npm ci
or npm install
.
src/pages/api/handler.ts
is an Edge Function in Vercel.
There is a limit of 500,000 "execution units" (50 ms of CPU time).
The Cache-Control
header is set in src/pages/api/handler.ts
.
You can customize browser and Vercel caching by setting the relevant headers.
PWA-level caching is set in cache.js
.
Note on Vercel caching: you'll only see cache misses in the logs; head over to DevTools to see cache hits.