-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set the CacheControl property on stored blobs #6297
Conversation
@@ -318,6 +318,7 @@ public async Task SaveFileAsync(string folderName, string fileName, Stream file, | |||
} | |||
|
|||
blob.Properties.ContentType = GetContentType(folderName); | |||
blob.Properties.CacheControl = CoreConstants.DefaultCacheControl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this adding cache control to all files saved to blob storage in the gallery? Or just packages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This affects all uploaded blobs for all blob containers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to only affect the packages container.
switch (folderName) | ||
{ | ||
case CoreConstants.PackagesFolderName: | ||
return CoreConstants.DefaultCacheControl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: PackageCacheControl
instead of Default
@@ -549,6 +550,7 @@ private static string GetContentType(string folderName) | |||
case CoreConstants.PackageReadMesFolderName: | |||
return CoreConstants.TextContentType; | |||
|
|||
case CoreConstants.ContentFolderName: | |||
case CoreConstants.RevalidationFolderName: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this addition? A test should cover it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The the content type tests skipped ContentFolderName
, which caused it to fail my new test. I'll fix the content type test.
This sets the
CacheControl
property on all packages blobs to 2 minutes.Fixes #6285