Skip to content
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

Add a command to generate a varnish vcl file based on current configurations and listeners #568

Open
alexander-schranz opened this issue Sep 29, 2021 · 1 comment

Comments

@alexander-schranz
Copy link
Contributor

alexander-schranz commented Sep 29, 2021

Based on the bundle configuration (user_context_hash, xkey, ...) and registered http cache subscribers (e.g. CustomTtlListener, UserContextListener, ...) it would be greate to generate the .vcl file.

Specially in cases like FriendsOfSymfony/FOSHttpCache#496 reported by @bastnic. The FOSHttpCacheBundle could provide performant vcl for the current configuration.

@dbu
Copy link
Contributor

dbu commented Sep 30, 2021

i fixed the VCL snipped we provide in FriendsOfSymfony/FOSHttpCache#497 but got sidetracked because the CI had rotted and i started the switch to github actions. that is FriendsOfSymfony/FOSHttpCache#500 which i did not get around to figure out yet because live happened...

FOSHttpCache provides the various VCL snippets you need - the performance fix needs to be done in those snippets, adding a command here does not solve that problem.

however, there is value in your idea. such a command would make it easier for new users to get started without having to figure out which snippets exactly they need.

my idea for the snippets is that you use VCL to include the individual files to keep the main VCL small and clearly visible which parts are written by the user and which are the snippets provided by FOSHttpCache. this makes it easier to follow upgrades, e.g. the context hash performance optimization that you mentioned.

if you want to work on such a command, i'd suggest we generate a very barbone VCL that references the snippets that you need and calls the methods as necessary to make varnish work with the symfony configuration. we could put all that into a build folder and also copy the snippets there so people can just use the build folder as a starting point for varnish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants