- Newest
- Most votes
- Most comments
Hello,
Enable Cache Busting: Use ManifestStaticFilesStorage in your settings.py to append a version or hash to static file URLs:
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
Check Nginx Caching: Ensure your Nginx configuration properly handles caching
location /static/ {
expires max;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
Update Docker Config: Make sure Docker removes old images and volumes:
docker system prune -af
CloudFront Invalidation: If using CloudFront, invalidate the cache after deployments:
aws cloudfront create-invalidation --distribution-id YOUR_DISTRIBUTION_ID --paths "/*"
Docker Volume Mounts:
Verify volume mounts: Double-check your docker-compose.yml file to ensure static files are mounted as volumes from your Django container to the Nginx container. This ensures changes in the Django container reflect in Nginx.
Elastic Beanstalk Caching:
Disable EBS caching: While less likely in your case, EBS might be caching deployments. This can be disabled in the Elastic Beanstalk configuration under "Software and platform updates" -> "Environment updates" -> "Deployment policy" -> "Discard caches before each deployment".
Relevant content
- asked 2 years ago
- asked a year ago

Can you exaggerate more on the first step. I wanna apply that solution.