Skip to content

Commit 4d5aeec

Browse files
committed
Merge branch 'prevent-json-caching' into 'main'
Prevent metadata caching See merge request fun-tech/shutterbug!58
2 parents 6657712 + 9864314 commit 4d5aeec

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

public/.htaccess

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Prevent caching of JSON generated by banner-screenshots
2+
# The JSON is our "serverless API" and must therefore not be cached
3+
# Code inspired by https://www.a2hosting.com/kb/developer-corner/apache-web-server/turning-off-caching-using-htaccess
4+
#
5+
# This file will only work when hosted on an Apache web server, not in the dev environment
6+
<FilesMatch "(metadata_summary.json|metadata.json)$">
7+
<IfModule mod_expires.c>
8+
ExpiresActive Off
9+
</IfModule>
10+
<IfModule mod_headers.c>
11+
FileETag None
12+
Header unset ETag
13+
Header unset Pragma
14+
Header unset Cache-Control
15+
Header unset Last-Modified
16+
Header set Pragma "no-cache"
17+
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
18+
Header set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
19+
</IfModule>
20+
</FilesMatch>
21+

0 commit comments

Comments
 (0)