Download the PHP package heyday/silverstripe-cacheinclude without Composer

On this page you can find all versions of the php package heyday/silverstripe-cacheinclude. 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 silverstripe-cacheinclude

SilverStripe Cache Include

Build Status

Template caching based on urls not DB queries.

Features

Installation

How to use

Enabling

To be able to invalidate caches from DataObject writes, add the InvalidationExtension:

  1. C te a config file mysite/_config/caching.yml
  2. Add the following to the yml file

Template Usage

Cache a section of a template:

Cache an included template (assumes a cache block config name of SomeTemplateName):

Cache an included template with a different cache block config name:

Cache block config

For each cache block that is used, you need a corresponding config provided to CacheInclude.

The following is an example of a config for SomeCacheBlock and AnotherCacheBlock:

mysite/_config/caching.yml

Configuration options

Key creation options:

context

Context is a method to tell the key creator what information about the request to include in the created key.

Possible values:

expires

Possible values:

member

Possible values:

versions

Possible values:

This is useful for when a cache block contains random content, but you still want caching.

e.g. set to 20 to get 20 (potentially) different version of a cache block.

Cache invalidation options

contains

invalidation_rules

The Expression Language is provided by Symfony, but also has the following available:

Variables
Functions

Theses can be used to do the following:

Full request caching

CacheInclude comes with a RequestCache service that can be added to cache full request objects for use in high load sites.

Enabling

To enable the full request cache, the RequestCacheMiddleware needs to be applied and a Global config block needs to be created:

Note: the After: condition in the above example is important. Without it, the middleware that handles request caching will run before SilverStripe's authentication middleware - meaning that the current user (stored in the session) isn't available. This could result in cache contamination between users, or between guests & registered users.

Full request caching increases performance substantially but it isn't without a cost. It can be hard to configure, as there are numerous cases where you don't want to either cache a request or alternatively serve a cached request.

To help in this there is quite a bit you can do out of the box to configure the way that caching is handled.

The following gives some demonstration of how to configure things and what you can do:

As you can see above there are some variables made accessible to you in the expression language.

The following is made available in the "Save" rules:

The following is made available in the "Fetch" rules:

Additional variables can be provided through the injector system.

Customisation

Because of the heavy usage of dependency injection and the SilverStripe Injector component, most parts of CacheInclude can be completely customised by replacing the standard classes with ones of your own.

Key Creators

CacheInclude comes built in with one key creator Heyday\CacheInclude\KeyCreators\ControllerBased. This key creator makes keys based on the config supplied in yaml, the current request and the environment.

You can create your own key creators by extending the KeyCreatorInterface and specifying the creator's service name from the template.

License

SilverStripe CacheInclude is released under the MIT license

Contributing

Unit Testing

Code guidelines

This project follows the standards defined in:

Run the following before contributing:


All versions of silverstripe-cacheinclude with dependencies

PHP Build Version
Package Version
Requires silverstripe/framework Version ^5.0.0
symfony/expression-language Version ^6.3.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 heyday/silverstripe-cacheinclude contains the following files

Loading the files please wait ....