Skip to content

Commit

Permalink
hashed files are immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Nov 6, 2024
1 parent aec8a7f commit a0bfc31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routes/cdn.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function send_from_bucket(hash, operation, res){
return stream_file(pkg).pipe(
res.type(type).attachment(name).set({
'Content-Length': pkg.length,
'Cache-Control': 'public, max-age=31557600',
'Cache-Control': 'public, max-age=31557600, immutable',
'Last-Modified' : pkg.uploadDate.toUTCString()
})
);
Expand All @@ -88,7 +88,7 @@ function send_from_bucket(hash, operation, res){
var tarname = name.replace(/(tar.gz|tgz)/, 'tar');
return stream_file(pkg).pipe(gunzip()).pipe(
res.type('application/tar').attachment(tarname).set({
'Cache-Control': 'public, max-age=31557600',
'Cache-Control': 'public, max-age=31557600, immutable',
'Last-Modified' : pkg.uploadDate.toUTCString()
})
);
Expand Down

0 comments on commit a0bfc31

Please sign in to comment.