mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
help: Cache pagefind hashed files aggressively.
Pagefind files with the extensions `pf_fragment`, `pf_mindex` and `pf_meta` are hashed in pagefind and thus we can cache it agressively. Other files in pagefind are not hashed, although they only change between different versions, we can think about a caching strategy for it later.
This commit is contained in:
committed by
Alex Vandiver
parent
e0811dc2a4
commit
1a34016e4a
@@ -48,6 +48,12 @@ location /help {
|
|||||||
index /index.html;
|
index /index.html;
|
||||||
try_files $uri $uri/index.html =404;
|
try_files $uri $uri/index.html =404;
|
||||||
|
|
||||||
|
# These files are hashed and thus immutable; cache them aggressively.
|
||||||
|
# https://github.com/Pagefind/pagefind/issues/747#issuecomment-2510564644
|
||||||
|
location ~ ^/help/(pagefind/.*\.(?:pf_fragment|pf_index|pf_meta))$ {
|
||||||
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||||
|
}
|
||||||
|
|
||||||
# These files are hashed and thus immutable; cache them aggressively.
|
# These files are hashed and thus immutable; cache them aggressively.
|
||||||
# https://github.com/withastro/docs/blob/53603ad048e8aedbca1aed77bac8eb00dcada79d/src/content/docs/en/guides/integrations-guide/node.mdx?plain=1#L304
|
# https://github.com/withastro/docs/blob/53603ad048e8aedbca1aed77bac8eb00dcada79d/src/content/docs/en/guides/integrations-guide/node.mdx?plain=1#L304
|
||||||
location /help/_astro/ {
|
location /help/_astro/ {
|
||||||
|
Reference in New Issue
Block a user