-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
Kevin/site-perf-3 Improve loading speed with django compressor #5106
Kevin/site-perf-3 Improve loading speed with django compressor #5106
Conversation
You might want to revert that later for windows compatibility, or add a flag for each OS
<script src="{% static "v2/js/jobs.js" %}"></script> | ||
<script src="{% static "v2/js/avatar_builder.js" %}" defer></script> | ||
{% endcompress %} |
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.
would it be possible to move any js files that are not compressable (because they are hosted elsewhere, or they are dynamically generated like tokens_dynamic
) to below the compress block and then only have ONE compress block?
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 applies in more than just this file ..
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.
Sure, I'm working on that !
this looks really good. just had one question, then can merge to #4826 |
@MajorTomSec I'm gonna try and get @owocki PR in tom ! Also, i believe we can go ahead without compressing any of the email stuff ! That's fine Neat job on commit 561f1af PS: conflict resolution needed |
Last commit fixed conflict @thelostone-mc, thanks for pointing it out. |
PR looks good to me; as long as |
@MajorTomSec mind checking out the comment here : |
Description
This PR adds many compress tags for both JS and CSS static files.
Using
python3 manage.py compress --follow-links --force
, we create a cache used for serving the aggregated minimized static files, thus improving the loading speed of the platform for the end user.This PR also fixes some typos and issues from previous commits, and temporarily fixes a bug where the building process would fail on linux, due to some options passed to
pip
. This needs to be fixed in a better way in order to improve compatibility across different OS.This PR needs to be reviewed, as a lot of changes have been made. I can confirm the loading time is significantly improved through these changes, but this needs more testing and reviewing to confirm this doesn't break anything.
python3 manage.py compress --follow-links --force
successfully passes all templates, except the following:Compressing... Error parsing template /code/app/retail/templates/emails/grants/transaction_summary.html: code/app/retail/templates/emails/emails/template.html Error parsing template /code/app/retail/templates/emails/grants/update_notification.html: code/app/retail/templates/emails/emails/template.html done Compressed 158 block(s) from 256 template(s) for 0 context(s).
I have not been able to fix this issue. It was not introduced in this PR and already happened when I started working on @owocki 's base PR.
Refers/Fixes
This is a PR aiming to fix issue #5091
This is based on @owocki 's work from PR #4826