4

I'm having an issue with static files piling up on S3 since i'm using the ManifestFilesMixin mixin to give static files a unique name (so clients are forced to load the new content). Since the name is different on each version (duhhh) it's written next to old version of the same file.

Then also i don't like to use the --clear flag on collectstatic since this will (i expect) remove the current files even when deployment has not succeeded yet.

I thought to manually run: python manage.py collectstatic --clear but this seems to not remove the old versions from the bucket?

Anyone thoughts on this?

Paul

Paul Bormans
  • 1,292
  • 16
  • 22
  • This is old one, but still. I've just checked with Django 3.2.8 and `--clear` deletes all the old files from S3. indeed it deletes before uploading, but yet, if you are using cloudfront's distribution, there is an active cache and the site had no downtime. Cheers! – eplaut Oct 07 '21 at 06:46

0 Answers0