-
Notifications
You must be signed in to change notification settings - Fork 225
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
Update <link> static assets to use the new domain #8916
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e07f333
Update static asset url used in link tags
jimjohnsonrollings 5f019d8
Update unit test
jimjohnsonrollings 4298061
Update integration test snapshots
jimjohnsonrollings 7e813a0
Update readme to say yarn instead of npm
jimjohnsonrollings 638dee1
Merge branch 'latest' into linkurls
jimjohnsonrollings 9dc4491
Merge branch 'latest' into linkurls
jimjohnsonrollings f7563e6
Merge branch 'latest' into linkurls
jimjohnsonrollings 488087e
Merge branch 'latest' into linkurls
chris-hinds File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 cache-control header max-age is different
Old endpoint:
curl -Is https://static.files.bbci.co.uk/ws/simorgh-assets/public/news/images/icons/icon-128x128.png
cache-control: max-age=31622400
(366 days)New endpoint:
curl -Is https://news.files.bbci.co.uk/include/articles/public/news/images/icons/icon-128x128.png
cache-control: max-age=604800
(7 days)and a new header:
strict-transport-security: max-age=2592000
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 cache control change is I think deliberate - we didn't want so long on the new one so that we can more easily update the images, and settled on seven days as reasonably short without being too short.
I don't know about the other one, but maybe @chris-hinds or @jamesdonoh do?
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.
Okay. To enable updates to logo files, I'd suggest a better model would be to include a hash of the file content in the filename and keep a long cache-control max-age.
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.
Ok thanks.
Given this PR is just updating this URL to be consistent with the ones already in the manifest files, would it be okay to proceed with this as is, and I can write a new issue to cover considering the caching approaches?
cc @joshcoventry
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.
So long as the team is happy with the cache hit going from 366 days to 7, sure.
Regarding the new header
strict-transport-security: max-age=2592000
(30 days) - this tells the browser to use HTTPS instead of HTTP for 30 days. This could also be extended to 366 days, since I don't believe this is expected to change.https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
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.
Apologies have only just seen this. Yes the cache changes were deliberate to ensure that we have a reasonable cache time but are able to still update the images.
Setting a hash in the url is a good idea but something we'd have to work on when the team has more time.
Regarding setting
strict-transport-security
we should work with the Mozart team on this and perhaps this is a default header that should be applied if it isn't already.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.
As per what Chris has said, happy for this PR to go out as is - we can pick up other work relating to the cache afterwards.
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've drafted an issue here for the caching stuff: #8931