Download the PHP package rocketweb/cache-warmer without Composer
On this page you can find all versions of the php package rocketweb/cache-warmer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rocketweb/cache-warmer
More information about rocketweb/cache-warmer
Files in rocketweb/cache-warmer
Package cache-warmer
Short Description Cache Warmer with a Pre-fetch option to validate Fastly Cache response
License MIT
Informations about the package cache-warmer
Cache Warmer (for Fastly CDN)
Info
This library allows for faster Cache Warmup when dealing with CDN (Fastly CDN & Cloudflare supported so far). It uses HEAD request to check for Cache status. If Cache Status is not a HIT, then full page load is executed which is then parsed for css/js/img elements and all those get requested also!
It supports smart caching, so you are not requesting the same Page/Element over and over again!
Installation & Usage
This library can be installed using composer:
Once installed, you can load it up using standard PSR-4 call. Example code:
The output is echoed directly and contains the following information:
Configuration
There are few things that can be configured:
-
you can set how many concurrent requests you want to execute to the server (applies to both Pages & Elements)
-
You can bypass the CDN Cache result for certain URLs which will force the Page to be loaded & all Elements to be fetched!
-
You can set up Alternative domains to be used when processing Elements on the Page (for example - your media is being served from different domain). You need to set that before calling
->run()
: - You can specify custom header & value to be matched against for CDN Caching validation. The validation is done thru
partial match (needle in haystack). You need to pass additional configuration into the
->run()
method:
The configuration gets merged together with default values (that support Fastly & Cloudflare):
For example, if you want to include DYNAMIC to be passed as Cached for Cloudflare:
All versions of cache-warmer with dependencies
ext-curl Version *
ext-dom Version *