jazzband / django-pipeline

Pipeline is an asset packaging library for Django.
https://django-pipeline.readthedocs.io/
MIT License
1.52k stars 372 forks source link

Pipeline serves old packages? #225

Closed toabi closed 11 years ago

toabi commented 11 years ago

I have a weird error which I'm not sure who's the responsible.

I have a bunch of apps which all are served from the same django source tree, the difference is just the database which is set by environment variables.

The instances are run in a uwsgi container. (More specifically, the uwsgi emperor manages them). Nginx then distributes different subdomains to those uwsgi sockets.

When I recently update the project and reload all instances, they use the new templates and new code, but some of them point to old javascript. Some of them link to the new code. This seems very weird to me. Because they all use the exact same code and configuration (except database). And I can see that they are using the updated code because the view results return new data.

Is there some caching going on in pipeline? How is the "link to the latest package" calculated? I'm a bit clueless here because also restarting the instances doesn't fix the issue.

cyberdelia commented 11 years ago

It's staticfiles job, check that you're running collectstatic with the right cache settings (hint: you can use NonPackagingPipelineCachedStorage if needed).

toabi commented 11 years ago

Hmm okay, I found out that if I run a collectstatic specifically for the instance which serves the old files, it suddenly works there. The thing is, that it's not consistent. All the instances use the same code and same static files, and some of them use the new ones although I didn't do a collect for them… I'll look into different cache settings and play a bit around. Thanks.

toabi commented 11 years ago

I found out what the problem was: I recently started using the CACHE for someting with a rather high timeout. I didn't think that staticfiles will share this cache for the generated filenames.