-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtaccess.example
More file actions
38 lines (34 loc) · 1.5 KB
/
Copy pathhtaccess.example
File metadata and controls
38 lines (34 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# DRI Voyager — example Apache cache policy for a served catalog.
#
# Reference mapping only; the concrete target host is TBD, so tune paths/CDN
# rules to your deployment. The two tiers below are the invariant that makes
# cache-busting safe:
#
# * hashed assets (….<8 hex>.glb / .ktx2) -> immutable, cache forever
# * manifest.json / index.json -> always revalidate
#
# A viewer re-fetches the manifest (cheap, revalidated), sees the new hashed
# URIs, and pulls the new immutable assets. Old hashed assets kept by
# `voyager-preppy --prune --prune-keep N` still resolve for clients holding a
# previously served manifest during a rollover.
<IfModule mod_headers.c>
# Content-hashed assets never change under a given name: cache for a year.
<FilesMatch "\.[0-9a-f]{8}\.(glb|ktx2)$">
Header set Cache-Control "public, max-age=31536000, immutable"
</FilesMatch>
# Stable-named scene descriptors: revalidate every load so new hashed URIs
# are picked up immediately.
<FilesMatch "(^|/)(manifest|index)\.json$">
Header set Cache-Control "no-cache"
</FilesMatch>
# Stable-named thumbnails: short cache, they may be regenerated in place.
<FilesMatch "_thumb\.jpg$">
Header set Cache-Control "public, max-age=3600"
</FilesMatch>
</IfModule>
# Ensure the glTF binary + KTX2 are served with sensible types (Apache may not
# know them out of the box).
<IfModule mod_mime.c>
AddType model/gltf-binary .glb
AddType image/ktx2 .ktx2
</IfModule>