Download the PHP package webignition/simplytestable-pagecache-bundle without Composer

On this page you can find all versions of the php package webignition/simplytestable-pagecache-bundle. 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 simplytestable-pagecache-bundle

Symfony 4 bundle for creating/validating cacheable responses

Introduction

Easily make cacheable Response objects to be returned from your controllers for content that:

A created cacheable response has the following headers set:

Subsequent requests made by a browser will include a If-None-Match: <hash of unique identifier> header which we can then use to determine if we should tell the browser to re-use the previously-cached response.

Installation

Install via composer:

Use composer to add as a project dependency:

composer require simplytestable-pagecache-bundle:^0.1

Update your database schema:

Details of cache-related headers previously sent are persisted to an object store. This bundle provides an entity, you need to update your database schema to allowt the entities to be persisted.

./bin/console doctrine:migrations:diff
./bin/console doctrine:migrations:migrate

Usage

This bundle provides a SimplyTestable\PageCacheBundle\Services\CacheableResponseFactory service. Use this as a type-hint in a controller constructor or in a controller action.

Minimal usage

Uniquely identifiying a response

The request route ($request->attributes->get('_route') and the request accept header ($request->headers->get('accept') are used by default to determine the uniqueness of a request.

CacheableResponseFactory::createResponse() takes as its second argument an array of parameters that will be used in addition to the above. For example, if your page renders a blog post, you would want to add to the parameters the unique id of the post.

The array keys can be anything you like. The corresponding array values can be anything but they must be scalar types or objects that cast to scalars (such as an object with a __toString() method.

Removing cache-related entities

Your controller actions will continue to return 304 Not Modified responses regardless of whether the content has changed so long as the unique identifiers still match.

You will need to remove cache-related entities upon content changes. A good time to do so is right after deploying changes to production.

A command is provided to make this super easy:

./bin/console simplytestable:pagecache:cachvalidator:clear

You may have many, many, many cache-related entities to remove. These may take some time to process. The command will process removals in batches. The default batch size is 100.

You can specify whatever batch size you need:

./bin/console simplytestable:pagecache:cachevalidator:clear 1
./bin/console simplytestable:pagecache:cachevalidator:clear 10
./bin/console simplytestable:pagecache:cachevalidator:clear 345
./bin/console simplytestable:pagecache:cachevalidator:clear 1000

Contrinbuting

Need a change? Spotted a bug? Feel free to fork and create a PR against this repo. I'm happy to consider any changes.

A PR will kick off a Travis CI build that runs code quality checks and runs the test suite.

If you make any changes, please make sure that:


All versions of simplytestable-pagecache-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
doctrine/doctrine-bundle Version ^1.6
doctrine/orm Version ^2.6
symfony/config Version ^4.1
symfony/dependency-injection Version ^4.1
symfony/framework-bundle Version ^4.1
symfony/http-kernel Version ^4.1
symfony/yaml Version ^4.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 webignition/simplytestable-pagecache-bundle contains the following files

Loading the files please wait ....