Giter Site home page Giter Site logo

Comments (7)

iquito avatar iquito commented on July 19, 2024

Leave a comment if you have any questions or your own experiences to add! You can also find this discussion on Github to comment more easily: #1

from incoherent.

MrMage avatar MrMage commented on July 19, 2024

Hi Andreas,

Thank you for your post! It’s great to see some real-world performance numbers for preloading. I am also using thecodingmachine‘s Docker images without Timestamp validation in a small Kubernetes cluster.

However, my understanding is that preloading only works with PHP-FPM, so I have it disabled (using their Apache mod_php image). Also, I’m not quite sure how to serve static assets in conjunction with the PHP-FPM service, given that I’d need a separate container for serving HTTP requests. May I ask how you solved that problem in your particular case?

Greetings from Munich,
Daniel

from incoherent.

iquito avatar iquito commented on July 19, 2024

Preloading is not tied to PHP-FPM, so it should work with mod_php just like opcache does, as it is a part of opcache and configured in php.ini. PHP-FPM cannot serve static assets though (except if it goes through PHP), I use Nginx for that. In general you need some web server anyway to use PHP-FPM, so either Nginx or Apache, but Nginx has better performance and easier configuration, which is why I prefer it.

from incoherent.

MrMage avatar MrMage commented on July 19, 2024

from incoherent.

iquito avatar iquito commented on July 19, 2024

In my applications, the Nginx container is hardly ever restarted, because I just set up the assets directory as a volume for Nginx. A container generates the assets (with Webpack) and the results become immediately available for Nginx through the shared directory, and only PHP-FPM needs new containers for application deployments.

from incoherent.

MrMage avatar MrMage commented on July 19, 2024

Thank you! I did not consider the option of having the PHP-FPM container "provide" the static assets to the Nginx one at runtime; that is a great option.

from incoherent.

iquito avatar iquito commented on July 19, 2024

It is a good use case for volumes, you can even make it read-only for Nginx. I also do not delete old versions of the assets, so they are only ever added.

The main drawback/complication is that you need to generate the assets separately from the PHP container, but that also has the advantage that something like Webpack is only needed when generating the assets, not for the PHP containers themselves.

from incoherent.

Related Issues (4)

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.