[tech] Questions about cache

>    There was a thread about this in early November:
> 
> 	gemini://gemi.dev/gemini-mailing-list/messages/003077.gmi
> 
>    It appears that half want caching, half don't.  It's a mess.

Well that's embarrassing. I don't know how I missed that *blush*. Thanks 
for the link and sorry for the noise.

In case anyone is curious, this is the solution I came up with to 
prevent caching. I have a cgi script like this:

if [ -z "$QUERY_STRING" ]; then
   printf '30 %s?%s\r\n' \
     "$(basename "$SCRIPT_PATH")" \
     "$(date | tr ' :' __)"
else
   printf '20 text/gemini\r\n'
   generate_content
fi

Basically, if there is no query string on the path, it redirects you to 
the same page with a cache busting query string constructed from the 
current date and time. If there is a query string, it gives you the content.

It's not perfect. A user could bookmark a page with a cache busting 
string on it and then see the same static page until it went out of 
their cache. I don't think there is a way around that though.

~Stephen

---

Previous in thread (6 of 13): 🗣️ Alex // nytpu (alex (a) nytpu.com)

Next in thread (8 of 13): 🗣️ Petite Abeille (petite.abeille (a) gmail.com)

View entire thread.