Skip to content
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

Adds local static cache for .scss and .js files #8409

Merged
merged 1 commit into from
Feb 18, 2021

Conversation

gdixon
Copy link
Contributor

@gdixon gdixon commented Feb 18, 2021

Description
  • Saves a local copy of .scss and .js assets (with and without hash) during collectstatic so that compressor can instrument cache over STATIC_ROOT
Refers/Fixes

Refers: #8368

Testing

Tested in dev with production ENV's

Screenshot 2021-02-18 at 09 48 49

Copy link
Contributor

@chibie chibie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM codewise... let's see how it plays out in prod experiment.

# Only save .scss and .js files locally
if ".scss" in name or ".js" in name:
# restore the clean file_content
content.file = file_content
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we do this ? would content.file change after we invoke L60 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have gzip enabled and from what I can tell, it's applied locally before the file is uploaded. We might not need it, but because we're saving multiple copies, I didn't want to risk losing the content.

@octavioamu octavioamu merged commit 9cd0bd3 into stable Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants