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

Offline Compression Error #443

Open
dasloss opened this issue Sep 25, 2013 · 6 comments
Open

Offline Compression Error #443

dasloss opened this issue Sep 25, 2013 · 6 comments

Comments

@dasloss
Copy link

dasloss commented Sep 25, 2013

I have spent a week debugging this (two different separate weeks) and am quite frustrated. I think I have read almost every article/blog post/issue out there, and don't know what to do. I have both a staging server and a production server (each with separate s3 buckets) and this works on staging, but not production, even though the servers (on Heroku) and the buckets are identical.

I have made it so compress tags only show up in the child template. I have removed all template tags from within compress tags (e.g if/else)., meaning I have more compress tags so the if/else statements can be outside the compress tags.

Does anyone have a functioning offline compression set up in production anywhere to look at? With compress offfline=False--there is significant extra load on the server, frequently an extra 300-500 ms delay, which obviously isnt worth it and defeats the whole purpose of this package.

I could really use some help, but basically have no idea what to do at this point, because its the same issue you can read about with hundreds of people in the issue list here, in blog posts elsewhere, and no repeatable solution seems to be being suggested--which is a huge problem for something this crucial to performance and that probably any Django deployment requires.

@shalakhin
Copy link

The same here. Seems django_compressor's COMPRESS_OFFLINE makes more problems than solves. I can't get it to work because receive such messages:

OfflineGenerationError: You have offline compression enabled but key "%s" 
is missing from offline manifest. You may need to run "python manage.py compress".

@neara
Copy link

neara commented Jan 19, 2014

Same here :/

Can't get offline compression to work. Keep getting OfflineGenerationError.

@sidmitra
Copy link

So i made sure i run the following during each deploy on all web servers

python manage.py compress --force
python manage.py collectstatic

That should refresh the manifest.json file. Also i make sure the name of manifest file is different with each push. Like add a version number. manifest_%s.json
I use the latest git commit hash id to plugin %s. So during deploy it does a git pull, compress, collectstatic, creating new minified/aggregated css/js with a new manifest.json file.
And then i restart apache. So it should all be smooth.

Also i made sure collectstatic does not call --clear, to delete old static/* media.

Make sense?

@mattions
Copy link

ok I have exactly the same problem.
Anyone is running this offline from S3 in a reliable manner?

@mateuspadua
Copy link

@jordanjambazov
Copy link

Last days I was busy resolving the same problem, and here is what was the fix, in case it helps to somebody.

In one of the templates, where the issue was reproducible, I was using context. During offline compression there is no access to the context, that's why the key generated during offline compression, and the one from the response cycle are obviously going to be different.

Try to isolate the parts of JavaScript where you are relying on context to another block, which is outside the compress tag.

Hopefully this information helps somebody.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants