diff --git a/lapis2-docs/astro.config.mjs b/lapis2-docs/astro.config.mjs index 86e1d6698..2eededebf 100644 --- a/lapis2-docs/astro.config.mjs +++ b/lapis2-docs/astro.config.mjs @@ -173,6 +173,15 @@ export default defineConfig({ }, ], }, + { + label: 'Concepts', + items: [ + { + label: 'Caching', + link: '/maintainer-docs/concepts/caching', + }, + ], + }, { label: 'Tutorials', items: [ diff --git a/lapis2-docs/src/components/CacheSizeEndpointLink.astro b/lapis2-docs/src/components/CacheSizeEndpointLink.astro new file mode 100644 index 000000000..c65f3fda7 --- /dev/null +++ b/lapis2-docs/src/components/CacheSizeEndpointLink.astro @@ -0,0 +1,7 @@ +--- +import { getLapisUrl } from '../lapisUrl'; + +const link = getLapisUrl() + '/actuator/metrics/cache.size'; +--- + +{link} diff --git a/lapis2-docs/src/content/docs/maintainer-docs/concepts/caching.mdx b/lapis2-docs/src/content/docs/maintainer-docs/concepts/caching.mdx new file mode 100644 index 000000000..87f6362fd --- /dev/null +++ b/lapis2-docs/src/content/docs/maintainer-docs/concepts/caching.mdx @@ -0,0 +1,17 @@ +--- +title: Caching +description: LAPIS' caching concept +--- + +import CacheSizeEndpointLink from '../../../../components/CacheSizeEndpointLink.astro'; + +LAPIS uses Spring Boot's caching capabilities to cache insertion and mutation queries. +We decided to cache SILO actions that are relatively expensive to compute, +but don't return much data (measured in size of the response body). + +At the time of writing, we think that aggregated queries are fast enough to not require caching. +Details and FASTA actions are more expensive, but return potentially large amounts of data. + +LAPIS offers an endpoint to check the current cache size (in number of cached entries) at `/actuator/metrics/cache.size`: + + diff --git a/lapis2-docs/tests/docs.spec.ts b/lapis2-docs/tests/docs.spec.ts index 7010773e7..393cbe42c 100644 --- a/lapis2-docs/tests/docs.spec.ts +++ b/lapis2-docs/tests/docs.spec.ts @@ -87,6 +87,7 @@ const maintainerDocsPages = prependToRelativeUrl( ], '/references', ), + ...prependToRelativeUrl([{ title: 'Caching', relativeUrl: '/caching' }], '/concepts'), ...prependToRelativeUrl( [ { title: 'Start LAPIS and SILO', relativeUrl: '/start-lapis-and-silo' },