Skip to content

Caching

makeworld edited this page Dec 25, 2021 · 2 revisions

Amfora caches documents (aka "pages") it loads, to reduce latency: if you're navigating through history, or simply just returning to the same page again. This wiki page outlines which pages are cached and when. Note that Amfora's cache algorithm has changed for over time, this page just explains what is done for the latest release.

What kinds of pages are cached?

  • All text pages loaded over the network are cached
    • Unless a client cert was sent with the request: client certs means some sort of application is being used, which is often dynamic
    • Unless the request was due to a redirect: redirects are often used for changing content that shouldn't be cached, like redirecting to the same page when clicking a "button"
  • Gemini pages loaded from a proxy are cached
  • about: pages are not cached, although sometimes they're static and in-memory anyway, like about:version
  • file:// pages are not cached

Cache invalidation

  • The cache is optionally limited by size and/or number of pages, as set in the configuration file
    • The pages cached first will be removed first
  • It is also configurably limited by a timeout, so if the page was cached more than X seconds ago, it will be kept in memory but never used again
    • This out-of-date page being kept in memory will be replaced if an up-to-date version of the page is cached
    • It could also be removed due to size or number of pages limits