Download the PHP package cpsit/typo3-cache-bags without Composer

On this page you can find all versions of the php package cpsit/typo3-cache-bags. 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 typo3-cache-bags

![Extension icon](Resources/Public/Icons/Extension.svg) # TYPO3 extension `cache_bags` [![Coverage](https://img.shields.io/coverallsCoverage/github/CPS-IT/cache-bags?logo=coveralls)](https://coveralls.io/github/CPS-IT/cache-bags) [![Maintainability](https://img.shields.io/codeclimate/maintainability/CPS-IT/cache-bags?logo=codeclimate)](https://codeclimate.com/github/CPS-IT/cache-bags/maintainability) [![CGL](https://github.com/CPS-IT/cache-bags/actions/workflows/cgl.yaml/badge.svg)](https://github.com/CPS-IT/cache-bags/actions/workflows/cgl.yaml) [![Release](https://github.com/CPS-IT/cache-bags/actions/workflows/release.yaml/badge.svg)](https://github.com/CPS-IT/cache-bags/actions/workflows/release.yaml) [![License](http://poser.pugx.org/cpsit/typo3-cache-bags/license)](LICENSE.md)\ [![Version](https://shields.io/endpoint?url=https://typo3-badges.dev/badge/cache_bags/version/shields)](https://extensions.typo3.org/extension/cache_bags) [![Downloads](https://shields.io/endpoint?url=https://typo3-badges.dev/badge/cache_bags/downloads/shields)](https://extensions.typo3.org/extension/cache_bags) [![Supported TYPO3 versions](https://shields.io/endpoint?url=https://typo3-badges.dev/badge/cache_bags/typo3/shields)](https://extensions.typo3.org/extension/cache_bags) [![Extension stability](https://shields.io/endpoint?url=https://typo3-badges.dev/badge/cache_bags/stability/shields)](https://extensions.typo3.org/extension/cache_bags) 📦 [Packagist](https://packagist.org/packages/cpsit/typo3-cache-bags) | 🐥 [TYPO3 extension repository](https://extensions.typo3.org/extension/cache_bags) | 💾 [Repository](https://github.com/CPS-IT/cache-bags) | 🐛 [Issue tracker](https://github.com/CPS-IT/cache-bags/issues)

An extension for TYPO3 CMS to build and register cache bags for enhanced cache control. Cache bags are built during runtime on uncached contents and can be used to define cache metadata like cache tags. In addition, they are used to calculate expiration dates for specific cache entries. This allows are fine-grained cache control, depending on the contents and their explicit dependencies like specific database contents or short-living API requests.

🚀 Features

🔥 Installation

Composer

TER

Alternatively, you can download the extension via the TYPO3 extension repository (TER).

⚡ Usage

Cache bags

A cache bag can be seen as some type of metadata collection for a specific cache scope, e.g. for the current page (Frontend-related cache). It is used to control the cache behavior within a given scope, for example by defining custom cache tags or an explicit expiration date.

At the moment the following cache bags are supported:

Cache bag Scope
Cache\Bag\PageCacheBag Enum\CacheScope::Pages

[!TIP] You can also add your own cache bags by implementing Cache\Bag\CacheBag.

Here is an example about how to generate a new PageCacheBag for a given page:

Cache bag registry

In order to actually use a generated cache bag, each bag must be registered in the global Cache\Bag\CacheBagRegistry. This registry is defined as singleton instance and stores all registered cache bags during runtime.

The CacheBagRegistry should be injected using dependency injection or, if DI is not possible, by using GeneralUtility::makeInstance():

Dispatched events

When adding a new CacheBag to the registry, a CacheBagRegisteredEvent is dispatched. It is used, for example, to apply cache tags to the current Frontend request (using the shipped PageCacheBagRegisteredEventListener).

Get closest expiration date

Based on all registered cache bags, the registry is able to calculate the closest expiration date (if any cache bag provides an expiration date) for a given cache scope:

This is used, for example, to apply the expiration date to the current Frontend page cache (using the shipped PageCacheLifetimeEventListener for TYPO3 ≥ v12 and PageCacheTimeoutHook for TYPO3 v11).

Cache expiration calculator

As already mentioned, cache bags may also store the expiration date of a targeted cache entry. The extension ships with a Cache\CacheExpirationCalculator that can be used to calculate an expiration date. The calculation is based on various input methods. At the moment, the following methods are available:

Full example

Typical use cases of cache bags are list and detail views of custom records in Frontend scope. Here is a full example about how to use the PageCacheBag in list and detail views of a custom table:

🧑‍💻 Contributing

Please have a look at CONTRIBUTING.md.

💎 Credits

The extension icon ("container") is a modified version of the original actions-container icon from TYPO3 core which is originally licensed under MIT License.

⭐ License

This project is licensed under GNU General Public License 2.0 (or later).


All versions of typo3-cache-bags with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0
psr/event-dispatcher Version ^1.0
psr/http-message Version ^1.0 || ^2.0
typo3/cms-core Version ~11.5.0 || ~12.4.0 || ~13.4.0
typo3/cms-extbase Version ~11.5.0 || ~12.4.0 || ~13.4.0
typo3/cms-frontend Version ~11.5.0 || ~12.4.0 || ~13.4.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 cpsit/typo3-cache-bags contains the following files

Loading the files please wait ....