I’m trying to enable images max-alive on the s3 bucket but it seems it’s not working with my config:
var s3Options = {
bucket: ‘app-images-bucket’,
region: ‘eu-west-1’,
bucketPrefix: ‘’,
directAccess: false,
baseUrl: ‘null’,
baseUrlDirect: true,
signatureVersion: ‘v4’,
globalCacheControl: “public, max-age=31536000”,
validateFilename: () => null,
generateKey: filename => filename,
}
When I retrieve the image and inspect headers I’m not getting max-age and image is retrieved every time again when I refresh the site. What am I doing wrong?
I’m using parse-server on Express.
Headers that I get back from the server are:
Access-Control-Allow-Headers: X-Parse-Master-Key, X-Parse-REST-API-Key, X-Parse-Javascript-Key, X-Parse-Application-Id, X-Parse-Client-Version, X-Parse-Session-Token, X-Requested-With, X-Parse-Revocable-Session, X-Parse-Request-Id, Content-Type, Pragma, Cache-Control, X-Locale, Content-Type, Origin, Accept, X-Requested-With, Access-Control-Request-Method, Access-Control-Request-Headers
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: X-Parse-Job-Status-Id, X-Parse-Push-Status-Id
Connection: keep-alive
Content-Length: 26870
Content-Type: image/png
Date: Wed, 25 Aug 2021 14:20:13 GMT
Keep-Alive: timeout=5
X-Powered-By: Express