Git Product home page Git Product logo

Comments (2)

BoPeng avatar BoPeng commented on August 15, 2024

I think I did not pay close attention to the Origin Domain Name part of the documentation. If I understand correctly, whitenoise + CDN works like this

  1. white noise continues to serve static files through https://mycompany.com/static/. This is why STATICFILE_STORAGE should not be changed.
  2. The website tells the client to retrieve static files through CDN, say, https://d4663kmspf1sqa.cloudfront.net/static.
  3. If the file has never been accessed before, the CDN server will grab its content from origin domain name, which is https://mycompany.com/static/. After the first attempt, the file will be cached so subsequent access to static file will be handled by the CDN.

The problem with digital ocean, in my case, is that https://myspace.sfo2.cdn.digitaloceanspaces.com/myfolder/static/ will only serve files stored on https://myspace.sfo2.digitaloceanspaces.com/myfolder/static/, so whitenoise will not work with my configuration. If I want to serve static files to CDN, I will have to use a boto3 storage to store static files to the bucket, or use cloudfront to point to the https://mycompany.com/static/.

from whitenoise.

adamchainz avatar adamchainz commented on August 15, 2024

Yes, that is correct, thank you for your clear issue report and self-solve!

from whitenoise.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.