1
0
Fork 0
mirror of https://github.com/Luzifer/past3.git synced 2024-11-10 00:40:00 +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 allUsersURI = 'http://acs.amazonaws.com/groups/global/AllUsers'
const dateFormat = 'YYYY-MM-DD HH:mm:ss' const dateFormat = 'YYYY-MM-DD HH:mm:ss'
const defaultCacheControl = 'no-cache'
// showAlert creates an alert message and displays it // showAlert creates an alert message and displays it
function showAlert(type, msg, timeout = 0, actions = {}) { function showAlert(type, msg, timeout = 0, actions = {}) {
@ -379,6 +380,7 @@ function saveFile(filename, content) {
ACL: pub ? 'public-read' : 'private', ACL: pub ? 'public-read' : 'private',
Body: content, Body: content,
Bucket: window.past3_config.bucket, Bucket: window.past3_config.bucket,
CacheControl: defaultCacheControl,
ContentType: mime.mime, ContentType: mime.mime,
Key: getFilePrefix() + filename, Key: getFilePrefix() + filename,
ServerSideEncryption: 'AES256', ServerSideEncryption: 'AES256',