-
Notifications
You must be signed in to change notification settings - Fork 60
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
Cloudflare support #507
Cloudflare support #507
Conversation
I am not certain why the PHPStan, Travis CI and Scrutinizer status checks are failing. Can anyone give me any tips on this, or are there issues with the current GitHub action setup? |
Judging by commit history, CI is dead since May. |
@diimpp The CI seems to fail on:
|
/cc @dbu |
thanks a lot for the pull request! and happy to hear this library is powering w3.org 😊 travis-ci changed their offering and many project are moving away to github actions since then. i moved my other projects, but got stuck in #500 with trying to set up varnish in github actions. i will give it another go. scrutinizer fails because it would be the phpunit build that should push data to it... phpstan build probably fell apart with the symfony 6 release, i will look into that as well. the rendered documentation is built with an action in readthedocs - when you click on "Details" in the build action for readthedocs, you can check the docs for this branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i looked at the code, and seems good to me. i commented on a few nitpicks, and replied to your question about the HttpDispatcher.
doc/proxy-clients.rst
Outdated
the cache by URL and clearing all cache items. You need a `Cloudflare Enterprise`_ account to purge by cache tags. | ||
|
||
For purging the cache by URL please see the docs `Cloudflare Purge by URL`_ for information about headers you can | ||
pass to clear the cache correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am a bit confused by this sentence. does the user have to configure something specifically, or do invalidation requests in a specific way? or is that more of an implementation note? if the later, i would put it in the class phpdoc of the cloudflare ProxyClient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It contains details on how Cloudflare purges the cache by URL and which headers you need to pass to clear the cache correctly (if these are set in HTTP responses).
I have added this to the code phpdoc, but I think this is useful to know about in the docs too since it may confuse users if the cache is not cleared as they expect. I've reworded to try to make this clearer.
install symfony 5
setting up old varnish versions did not work, commenting out the legacy builds
* have no risky tests * fix deprecations
use github workflow
i fixed the build in the master branch. can you rebase please? |
improve caching of the user context hash lookup in Varnish
Send the right revision hash to Scrutinizer
pin version of psr6 store
Generate code coverage for Scrutinizer
Fix badges
Configure Scrutinizer filter
…che into cloudflare-support
Rebased master & updated my branch with a few changes as suggested above. |
finished in #516 - thanks a lot @simonrjones for this contribution! |
Background
I'm working on the w3.org redesign project and we'd like to add Cloudflare support to FOSHttpCache so we can use this library to help control full page caching.
Changes
Notes
I've tested this with real-world code (w3.org) for clear and purge. I need to test clearing tags but manual API tests work fine.
I can't build the docs locally so I'm not sure if I've got the formatting right for this. Also, the docs confused me a little since I had to specify the Cloudflare API URL in the HttpDispatcher to get this working. Not sure if this is correct & expected when working with an external CDN like Cloudflare:
For details about Cloudflare API:
Related discussion: #457