Download the PHP package alengo/sulu-bunny-cdn-bundle without Composer

On this page you can find all versions of the php package alengo/sulu-bunny-cdn-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sulu-bunny-cdn-bundle

AlengoBunnyCdnBundle

bunny.net CDN integration for Sulu/Symfony websites: tag-based edge cache invalidation wired into FOS HttpCache. On every Sulu publish, both the local HttpCache kernel and the bunny.net pull zone are purged — content updates go live worldwide in seconds instead of waiting for the TTL.

Architecture

Two cache layers, both invalidated on every publish:

The bunny.net single-tag pitfall

bunny.net stores the whole CDN-Tag header value as ONE tag — it does not split at commas or any other separator, and its purge API answers 204 even when nothing matches. Exact-match tag purges are therefore silent no-ops.

This bundle uses the working pattern (same as the Drupal bunny_cdn module): the header is written as a space-separated list with : … : guards (CDN-Tag: : a1b2c3d4e5f6 0f9e8d7c6b5a :), and purges use a wildcard pattern ({"CacheTag": "* a1b2c3d4e5f6 *"}) that matches the space-bounded tag inside the stored value.

1. Installation

The credentials default to env placeholders — set them in .env.local (never commit them):

The env vars must be set wherever the bundle is enabled — FOS flushes the invalidation queue on console.terminate, so the proxy client is instantiated by every console command.

All options:

Requires the FOS symfony proxy client (or adjust additional_proxy_clients):

2. Create the pull zone (bunny.net dashboard)

CDN → Add Pull Zone

Setting Value
Name e.g. example (becomes example.b-cdn.net)
Origin Type Origin URL
Origin URL https://origin.example.com — the host that reaches the web server WITHOUT the CDN. Must be https:// — with http:// the origin's force-SSL redirect (301 to the origin host!) gets cached and served to visitors.
Pricing Zones For GDPR-sensitive sites: enable Europe only

Under Hostnames:

3. Caching settings of the pull zone

Caching → General:

4. Edge rules (mandatory!)

bunny.net does not include cookies in the cache key. Personalized or logged-in requests must therefore BYPASS the edge cache (the origin kernel cache handles them correctly). Create these rules (Pull Zone → Edge Rules → Add Edge Rule):

Rule "SessionBypass" — logged-in users:

Rule "AdminNoCache" — never cache the admin:

Additional bypass rules for any personalization cookies your site uses (same action, conditions Request Header: Cookie with *cookie_name* patterns, "Match Any").

⚠ Cookie condition pitfall: do NOT use the Cookie Value condition type with pattern * — it also matches requests WITHOUT the cookie, the rule then applies to ALL requests and the whole zone becomes BYPASS (nothing is cached anymore). Use Request Header: Cookie with a substring pattern — a missing header never matches a substring.

Edge rules always need at least one condition. For rules that should apply to every request, use Request URL → matches → *.

CDN-Tag stays visible to browsers: response headers starting with CDN- cannot be set/cleared via edge rules ("Header names starting with CDN- are not allowed"). The header only contains 12-char hashes and is useful for debugging — leave it.

5. Host handling & origin lockdown

If the origin vhost only serves the origin hostname (and answers the public host with 421 Misdirected Request):

6. DNS

Point the public domain as CNAME to <zone>.b-cdn.net (only after SSL for the hostname is provisioned). The origin must stay directly reachable under its own hostname (A record, own vhost with TLS).

7. Verify

cdn-cache legend: MISS/EXPIRED/HIT = normal caching, BYPASS = an override-cache-time-0 rule matched. MISS after a purge = entry was gone; EXPIRED = regular TTL refetch.

⚠ Verifying purges: a 204 from the API proves nothing (bunny.net returns 204 even for non-matching tags), and a "successful purge" observed after the entry's TTL has expired is just the regular refetch. Always check cdn-cachedat WITHIN the TTL of the entry.

Publish test: change + publish a page in the admin → the next request to the live URL must return the new content within seconds.

8. Operations & limits


All versions of sulu-bunny-cdn-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
friendsofsymfony/http-cache Version ^3.0
friendsofsymfony/http-cache-bundle Version ^3.0
symfony/config Version ^7.2
symfony/dependency-injection Version ^7.2
symfony/event-dispatcher Version ^7.2
symfony/http-foundation Version ^7.2
symfony/http-kernel Version ^7.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alengo/sulu-bunny-cdn-bundle contains the following files

Loading the files please wait ...