#Caching Static pages with Sqlite

1 messages · Page 1 of 1 (latest)

unique flame
#

Here Ryan mentions that Remix Docs uses a SQLite cache for static pages.
https://twitter.com/ryanflorence/status/1462933552291467265?s=20&t=Gsj9K-ZYw3NoedbuIVyckw

Can someone provide me a basic overview and / or link to code somewhere in Remix Repo that does this?

Thanks

We don't put any caching on the documents or data requests so that the second the sqlite db is updated, you get the latest doc.

When we fix a doc typo it's live around the world within a minute. No redeploys and fast responses!

robust jay
#

what they do however, is they keep an SQLite deployed together with the app itself

#

so instead of reading the content for the docs from GitHub, they read it from SQLite which is way faster

#

then when they change something in GitHub they propagate the change to each SQLite copy

#

so every request to a page of the docs does a new SSR response, but because it reads from a DB deployed together with the app it's fast to read the data, and because they deploy multiple instance around the world it's fast almost everywhere

unique flame
#

That is very interesting and clever, actually.
So you are saying, that they take mdx strings from each file (of docs), stick it inside a local table, and read from there. And when they made changes, they also update that local SQL DB.

robust jay
#

they don't use MDX, plain MD, but yeah