FriendsOfSymfony / FOSHttpCacheBundle

Use the FOSHttpCache library in your Symfony projects
http://foshttpcachebundle.readthedocs.io
Other
430 stars 80 forks source link

Add cloudflare support #587

Closed jean-gui closed 1 year ago

jean-gui commented 1 year ago

Cloudflare Support as a proxy client has recently been added to fos http cache, but the bundle doesn't allow configuring it.

This PR is an attempt at adding this support. I tried to replicate what's being done for Varnish, but with options meaningful to Cloudflare.

# config/packages/fos_http_cache.yaml
fos_http_cache:
    proxy_client:
        cloudflare:
            zone_identifier: '<my-zone-identifier>'
            authentication_token: '<user-authentication-token>'
jean-gui commented 1 year ago

have you tried this branch in an actual application to sanity check if it actually works as expected?

I have tried it with invalidatePath(), and it seemed to work well.

dbu commented 1 year ago

https://github.com/FriendsOfSymfony/FOSHttpCacheBundle/releases/tag/2.15.0

dbu commented 1 year ago

thanks a lot!