-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Allow specifying the location of auto-generated preload file #39061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you @michaljusiega From your answer, it seems like #38343 reverted the change to #38063. I have 1 question if you don't mind: coming from SF3, we are using the latest SF4 version with the bundle structure from SF3 instead of the recipes in SF4. Looking at the code you linked to: opcache.preload=/path/to/project/src/preload.php I'm looking at my whole application structure and it doesn't seem like we are having the src folder (we have app, vendor, web folders. Our code are all inside vendor/ourname/ourbundle). Do I need to start using recipes now for this to work? Edit 1: After checking the preload file in more details, it seems like for our use case it wont work for now. The problem is the container:
Right now the container contains both the service definition and the paramterers. While all our service definition remains the same for every site, the parameter will be slightly different. I wonder why we need to include that container file though? Perhaps I can hack around by skipping it? |
I am not sure if I can help you. Sorry : < |
What's about using the same folder for all the website and using environment variables defined in Nginx/Apache to configure database/local/etc... ? |
During cache warmup, a preload script is dumped into your Symfony cache folder, whereever that is in your scenario. This feature should be usable without Flex and recipes. |
I'm closing because this looks like a request that relies on an outdated state of the topic. |
Also, be careful about your use case: you said that you have separate Twig templates, but TwigBundle also preloads the compiled template classes. |
Description
We use Symfony to power hundreds of websites. Each website has its own database, but they share exactly the same code base (same vendor and app folder). The only difference is the local folder where we may setup different locales etc.
Right now, the preload file is generated and put in each website cache folder, we can not set preload config file.
Example
Ideally, I think it can be like this:
opcache.preload=/path/to/shared/var/cache/prod/App_KernelProdContainer.preload.php
(the tricky thing here is that we cannot share cache folder, each site has different template files for example so they have their own twig cache I think. Some other parameters can be different as well so ideally we only share the preload)
My current preload.php (which looks exactly the same for each site) looks like this:
The text was updated successfully, but these errors were encountered: