Download the PHP package aimeos/pagible-cdn without Composer

On this page you can find all versions of the php package aimeos/pagible-cdn. 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 pagible-cdn

Pagible CDN

Purges changed pages and removed files of Pagible CMS from CDNs and caching proxies using FOSHttpCache. Supported are Cloudflare, Fastly and Varnish.

This package is part of the Pagible CMS monorepo.

Installation

Purge requests are sent by queued jobs on the CMS queue (CMS_QUEUE_CONNECTION, CMS_QUEUE), so run a queue worker:

Configuration

Settings are in config/cms/cdn.php. Each client is used as soon as its token or servers are set, all others are skipped:

Driver Environment variables
cloudflare CMS_CDN_CLOUDFLARE_TOKEN (API token with the "Zone.Cache Purge" permission), CMS_CDN_CLOUDFLARE_ZONE
fastly CMS_CDN_FASTLY_TOKEN, CMS_CDN_FASTLY_SERVICE, CMS_CDN_FASTLY_SOFT (default true, marks content as stale)
varnish CMS_CDN_VARNISH_SERVERS, comma separated, e.g. 10.0.0.1:6081,10.0.0.2:6081

Further settings:

Key Default Description
url APP_URL Scheme and host the CDN serves the pages and files from (CMS_CDN_URL)
delay 0 Seconds to wait before purging changed URLs, can be set per client too (CMS_CDN_DELAY)
limit 500 More URLs at once remove all content from Cloudflare and Fastly with one request instead, including files and assets, 0 disables it (CMS_CDN_LIMIT)
maxage page setting Seconds the CDN caches public pages (CMS_CDN_MAXAGE)
stale 0 Seconds the CDN serves outdated pages while refreshing them or if the server fails (CMS_CDN_STALE)
timeout 10 Seconds to wait for the response (CMS_CDN_TIMEOUT)

Cache lifetime

Public pages are sent with Cache-Control: public, s-maxage=... using the cache time of each page, while pages with access rules and pages viewed by editors are private. As changed pages are purged, the CDN can keep pages longer, e.g. CMS_CDN_MAXAGE=86400. CMS_CDN_STALE=60 adds stale-while-revalidate and stale-if-error, so the CDN serves the old page while fetching the new one or if your server is unavailable. If CMS_CDN_MAXAGE is set, the Expires header is removed so the CDN can't use the shorter lifetime of the page instead.

Varnish must be configured to accept PURGE requests from the application servers, see the FOSHttpCache proxy configuration.

Stacked caches

If a CDN caches the responses of Varnish, the inner cache must be purged first, otherwise the CDN fetches the outdated page from the inner cache again. Set a longer delay for the CDN client, e.g. 'delay' => 10. cms:cdn:purge purges the clients in the configured order, so list the inner cache first. If the purge of the inner cache fails, the CDN may cache the outdated page again until its cache lifetime expires.

Several zones or services

Add a client per zone or service and limit it to its host names with hosts, e.g. for multi-domain setups with one Cloudflare zone per domain:

What is purged

Not purged are:

Editors can purge a page and all its subpages with the "Clear cache" action of the admin panel. For the root page, this purges the whole site and large sites remove all content at once.

Commands

Removing all content is only supported by Cloudflare and Fastly.

Equal purges which are still queued aren't queued again, so large changes of shared content remove all content only once instead of once per batch of pages.

Removing all content also removes the cached images, CSS and JavaScript files, which are then fetched from your server again. If shared elements or files like the footer are used by more pages than the limit, each of their changes does this, so raise the limit or use 0 for large sites with frequent changes of shared content.

Protected content

Pages which get access rules and files moved to the private disk are only removed from the CDN by their purge. Until it succeeds, the CDN still serves the public copy:

For sites with protected content, use a real queue, keep maxage moderate and add the host of the public files to hosts.

Failures

Failed purges are retried after 10 seconds, 1, 5 and 15 minutes, also if the CDN API rejects requests because of its rate limit. Purges which failed after the last retry are stored as failed jobs by Laravel. Each client uses its own jobs, so a failing CDN doesn't delay the others. The job only contains the client name and URLs; credentials are read from the configuration when the job runs, so changed credentials apply to queued purges too and removed clients don't receive them any more.

With the sync queue, the URLs are purged after the response is sent to keep the admin panel fast. Failed purges are only reported then and not retried, so use a real queue in production.


All versions of pagible-cdn with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
aimeos/pagible-core Version ~0.13
friendsofsymfony/http-cache Version ^3.2
php-http/guzzle7-adapter Version ^1.1
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 aimeos/pagible-cdn contains the following files

Loading the files please wait ...