- integration : @astrojs/node
- adapter : node-standalone
- Astro API Astro.cookies.get()
This counter uses a cookie counter=1
to persist through pages relaod despite being a client counter.
For Astro SSR there is a simplicity advantage for using a cookie over using client sotrage :
- Automatically sent with every client request
- No display flicker
- no need to create a server endpoint to submit the client updated value (to avoid the flicker)
Note : Only a single counter is used in this example given that a single cookie is used
Note : For a demo using cookies, the Astro.cookies could only be read in Gitpod
-
todo : check example with blocking head script can solve ssg