Make DirectoryResolver Response Cacheable #76
Merged
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.
Description
Outlined in issue #52, resolvers were lacking caching headers, which was in turn causing some down stream issues in Fastly around text encoding/compression; which was dinging us on Lighthouse. I do think we should leave the issue open and have a general conversation about caching, because this issue is cross platform and also affects
upward-js, but this resolve some Magento Cloud specific issues in the meantime.As a starting point for, we're going to make the assumption that all static assets should be cached, and just hard-code this header into the Directory resolver.
Related Issue
Acceptance
Verification Stakeholders
Specification
Verification Steps
feature/upward-dependency-testingformagento/module-upward-connectordependency)client-<hash>.jsorvendor-<hash>.jsCache-Controlheader has amax-agevalue > 0Content-Encodingheader value isgzipScreenshots / Screen Captures (if appropriate)
Checklist