Download the PHP package thoughtco/statamic-cache-tracker without Composer

On this page you can find all versions of the php package thoughtco/statamic-cache-tracker. 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 statamic-cache-tracker

Statamic Cache Tracker

Statamic Cache Tracker keeps a record of what items (entries, assets, terms etc) are used in the output of each page, and clears the cache (full or half) for those pages when an item is saved.

How to Install

Run the following command from your project root:

You can also optionally publish the config:

How it works

The addon should work auto-magically in most cases. It listens for hooks in form, nav and partial tags, as well as augmentation of entries, terms, assets and globals to determine what content is being output.

This data is then added to a cache store that is used to determine what cached data should be invalidated when tracked items are saved or deleted. If you want to clear data on other events (eg clear any page builder elements on entry create), just add a listener and call invalidate on the Tracker facade (eg. Tracker::invalidate(['partial:_partials/my_pagebuilder_block']);

The default cache is used, or if you have specified a static_cache store this will be used instead. This data will then be cleared when your static cache is cleared.

Middleware

The autocache middleware will automatically be added to your web middleware stack. If you want to include it to other stacks simply add:

\Thoughtco\StatamicCacheTracker\Http\Middleware\CacheTracker::class

Tracker Facade

The addon comes with a Facade for interacting with the Tracker: \Thoughtco\StatamicCacheTracker\Facades\Tracker

Adding your own tracking data

If you have your own custom tracking data, for example for one of your own tags, you can register them on the Facade. Please bear in mind tracking only happens while the response is generated, so where possible use augmentation hooks.

Using a closure

Using an invokable class

Dispatching an event

Invalidating tracked data

To invalidate pages containing your tracked data, use a listener or observer, and call:


All versions of statamic-cache-tracker with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
pixelfear/composer-dist-plugin Version ^0.1.5
statamic/cms Version ^4.55 || ^5.0
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 thoughtco/statamic-cache-tracker contains the following files

Loading the files please wait ....