1
0
Fork 0
mirror of https://github.com/Luzifer/past3.git synced 2024-12-22 20:31:16 +00:00

Set cache-control to prevent browser caching

this prevents files being cached and not updated in the editor

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-01-14 11:45:45 +01:00
parent ab3315ce3b
commit c6f83318e7
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

2
app.js
View file

@ -1,5 +1,6 @@
const allUsersURI = 'http://acs.amazonaws.com/groups/global/AllUsers'
const dateFormat = 'YYYY-MM-DD HH:mm:ss'
const defaultCacheControl = 'no-cache'
// showAlert creates an alert message and displays it
function showAlert(type, msg, timeout = 0, actions = {}) {
@ -379,6 +380,7 @@ function saveFile(filename, content) {
ACL: pub ? 'public-read' : 'private',
Body: content,
Bucket: window.past3_config.bucket,
CacheControl: defaultCacheControl,
ContentType: mime.mime,
Key: getFilePrefix() + filename,
ServerSideEncryption: 'AES256',