-
Notifications
You must be signed in to change notification settings - Fork 325
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 support for Nginx Cache #6308
base: 2.5
Are you sure you want to change the base?
Conversation
Add support for Nginx Cache
Add support for Nginx Cache
Add support for Nginx Cache
This code is working fine for me, not sure what PHP Lint / PHPStan wants? |
@ampaze Thank you for the Pull Request. I think it is missing an import (use statement) of the Exception class, which is used when tags are enabled. But did not yet have time to test it out. |
The PHP Lint error is in files that where not modified with this pull request. Is there something else that prevents this PR from being merged? |
@ampaze This part looks fine. We also need to add a nginx example configuration like we are doing in the docs for varnish currently, which will be based on the current nginx vhost file if possible, else its fine for me as a reverse proxy configuration. I currently found only https://foshttpcache.readthedocs.io/en/latest/nginx-configuration.html which configuration seems not longer work, atleast for the free nginx version. Can you create a Pull Request with that also? Think I would like the current varnish configuration add it as a cookbook documentation |
I appreciate your desire to add better nginx support, but having an agreed upon example configuration ready before merging this will most likely take a long time. Smart caching with Nginx is unfortunately a bit more complex and not really copy and paste friendly. I am wiling to make my config available but I am not sure it is best suited for everyone out there.
Yes I hope to work on that when I had time to finish the Tagged Cached Invalidation for Nginx. Be aware: a complete and clean solution for this is currently not possible, as you don't want to change the |
This is I think the easiest thing as you can set the if ($response->headers->has(SuluHttpCache::HEADER_REVERSE_PROXY_TT)) {
$response->setSharedMaxAge($response->headers->get(SuluHttpCache::HEADER_REVERSE_PROXY_TTL));
} You could add that subscriber(
As nginx does not support tagged caching out of the box and nginx could be run on another server, the config in our case should just simple to allow caching and purging. So at current state it would be good to have a simple nginx config which take the |
Fair enough. Keeping it simple is always good :)
Unfortunately the free version does not support purging and you would need to compile This is one reason I think directly accessing the cache files is much more hassle free, but as you mentioned, this would be more difficult if |
What's in this PR?
Add support for Nginx Cache