wagtailyoast
wagtailyoast copied to clipboard
Large staticfiles directory
In the static/wagtailyoast/dist
directory there are js/css files for all the versions (0.0.1 - 0.0.9). Especially the yoastanalysis0.0.x.js
and yoastworker0.0.x.js
files are quite large and having them 9x makes the whole directory to be 39 MB large.
This slows down the whole collectatic process for my application (I use whitenoise with static files compression) and makes the distribution package unnecessarily huge and slows down the whole deplyment process.
Are the old versions of those libraries really needed?
@PetrDlouhy
If you use for example wagtailyoast==0.0.9
,
You can delete all yoastanalysis0.0.x.js
and yoastworker0.0.x.js
files except :
-
yoastanalysis0.0.9.js
-
yoastworker0.0.9.js
.
A version of these files is built for each release. They are independent between versions.
@Aleksi44 I already fixed this issue in my project by
class MyStaticFilesConfig(StaticFilesConfig):
ignore_patterns = [
"*wagtailyoast/*0.0.1*",
"*wagtailyoast/*0.0.2*",
"*wagtailyoast/*0.0.3*",
"*wagtailyoast/*0.0.4*",
"*wagtailyoast/*0.0.5*",
"*wagtailyoast/*0.0.6*",
"*wagtailyoast/*0.0.7*",
"*wagtailyoast/*0.0.8*",
]
but it seems very ugly and I will have to keep it in mind when updating to next releases. Other users might have unnecessarily large static files in their project.
Is there any reason, why it is needed to have the old versions in current distribution?
@PetrDlouhy
You are not supposed to have all these files. If you delete your STATIC_ROOT
folder where everything is collected and you re-run :
python manage.py collectstatic
Do you still have all those files?
I use a new file name for each release to avoid cache problems.
These files are in the PyPI package. If I download the tar.gz from the PyPI download page, those files are part of the package.
@PetrDlouhy
Sorry for this late reply. It seems that these are old files. For the next release, I will remove them, the package will be lighter.
@Aleksi44 Thank you very much.
@Aleksi44 It seems that in version 0.0.10
all those files are still present. Is there any systematic way to fix this issue?