-
Notifications
You must be signed in to change notification settings - Fork 683
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
Fix makeUrl for Fastly #1039
Fix makeUrl for Fastly #1039
Conversation
This pull request is automatically deployed with Now. |
|
||
export default memoize(formatUrl, storeUrlKey); | ||
export default formatUrl; |
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.
Could add memoization back at some point, but it should take useFastly
into account.
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.
Of course, it was the memoization. Should have figured that out.
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.
Ran local QA with imageOpt disabled and verified:
- All images ran through Fastly IO when
USE_FASTLY=1
- Images returned as full size when
USE_FASTLY
is unset orUSE_FASTLY=0
LGTM 👍
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.
Change looks even better with a descriptive docblock, nice add @sirugh.
Description
Fix
makeUrl
for Fastly image optimization.Related Issue
Motivation and Context
URLs from GraphQL are now absolute, and they include the media path logic we currently have in
makeUrl
. So we need to remove this logic and rewrite what remains to be compatible with absolute URLs. Also, we need to enable Fastly image optimization in certain environments.Verification
How Has This Been Tested?
yarn test