PHPackages                             quintype/caching - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. quintype/caching

ActiveLibrary[Caching](/categories/caching)

quintype/caching
================

1.2.5(4y ago)013.8kPHP

Since Dec 21Pushed 4y ago54 watchersCompare

[ Source](https://github.com/quintype/quintype-caching-php)[ Packagist](https://packagist.org/packages/quintype/caching)[ RSS](/packages/quintype-caching/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)DependenciesVersions (11)Used By (0)

quintype-caching-php
====================

[](#quintype-caching-php)

A composer package for caching for all quintype PHP projects. All publisher websites should be cached to reduce load to the server.

\###Important : If any change is made to the package, do the following.

- Create a new release.
- Update the package in [Packagist](https://packagist.org/).
- To use the new version of the package in any project, change the version number in composer.json file and run `$ composer update `

\###Instructions to include the package into a project.

#### In composer.json, require Caching package.

[](#in-composerjson-require-caching-package)

```
"require": {
        ...
        ...
        "quintype/caching":"1.0.0"
    },
```

#### Install or update the composer packages.

[](#install-or-update-the-composer-packages)

```
$ composer install
or
$ composer update
```

#### In the Laravel config/app.php file, add aliases to the packages for convenience.

[](#in-the-laravel-configappphp-file-add-aliases-to-the-packages-for-convenience)

```
'aliases' => [
        ...
        ...
        'Caching' => Quintype\Caching\Caching::class
    ],
```

#### Include both Caching class in the necessary controllers.

[](#include-both-caching-class-in-the-necessary-controllers)

```
use Caching;
```

#### Create a constructor function to initialize the Caching object and to set default caching parameters..

[](#create-a-constructor-function-to-initialize-the-caching-object-and-to-set-default-caching-parameters)

```
public function __construct(){
  $this->caching = new Caching();
  $this->defaultCacheParams = [
      'publisherId' => ,
      'cdnTTLs' => [
        'max-age' => 3 * 60,
        'stale-while-revalidate' => 5 * 60,
        'stale-if-error' => 4 * 60 * 60,
      ],
      'browserTTLs' => [
        'max-age' => 60,
      ],
  ];
}
```

#### Call the function using the created object. Pass all necessary details that will be used for setting cache headers to the function as an associative array.

[](#call-the-function-using-the-created-object-pass-all-necessary-details-that-will-be-used-for-setting-cache-headers-to-the-function-as-an-associative-array)

The argument is an associative array with following keys:

1. **publisherId**
2. **cdnTTLs**: Corresponds to Surrogate-Control values.
    1. **max-age**: This controls how long the page is considered fresh in the Database.
    2. **stale-while-revalidate**: During this period, the page is served from CDN, but updated in the background.
    3. **stale-if-error**: During this time, the page is served from CDN in case the backend server crashes for whatever reason.
3. **browserTTLs**: Corresponds to Cache-Control values
    1. **max-age**
4. **locationId***(not required for story page)*: home or section-id
5. **storyGroup***(not required for story page)*: top or stack-id
6. **storiesToCache**:
    1. Array of all collections under a key for each of them, if driven through collections.
    2. Array of all the stories that have to be cached, if driven through stories.
7. **storiesFrom***(required for collection driven page)*: collection

```
return response(view("home_page", $this->toView([])))
        ->withHeaders($this->caching->buildCacheHeaders(array_merge($this->defaultCacheParams, ["locationId" => "home", "storyGroup" => "top", "storiesToCache" => $storiesToCache])));

return response(view("section_page", $this->toView([])))
        ->withHeaders($this->caching->buildCacheHeaders(array_merge($this->defaultCacheParams, ["locationId" => $params["section-id"], "storyGroup" => $params["story-group"], "storiesToCache" => $storiesToCache])));

return response(view("story_page", $this->toView([])))
        ->withHeaders($this->caching->buildCacheHeaders(array_merge($this->defaultCacheParams, ["storiesToCache" => $storiesToCache])));

return response(view("collection_page", $this->toView([])))
        ->withHeaders($this->caching->buildCacheHeaders(array_merge($this->defaultCacheParams, ["locationId" => "", "storiesFrom"=> "collection", "storiesToCache" => $storiesToCache])));
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 76.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~202 days

Recently: every ~329 days

Total

10

Last Release

1610d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7149c6ca9a46e2a9b4ce5300eaffea9cbf632b313f4f4d3440573f93cd54f8c4?d=identicon)[quintype](/maintainers/quintype)

---

Top Contributors

[![anagh-p](https://avatars.githubusercontent.com/u/14992025?v=4)](https://github.com/anagh-p "anagh-p (13 commits)")[![asimqt](https://avatars.githubusercontent.com/u/30138643?v=4)](https://github.com/asimqt "asimqt (2 commits)")[![gja](https://avatars.githubusercontent.com/u/34746?v=4)](https://github.com/gja "gja (1 commits)")[![rashmirmittal](https://avatars.githubusercontent.com/u/46313225?v=4)](https://github.com/rashmirmittal "rashmirmittal (1 commits)")

### Embed Badge

![Health badge](/badges/quintype-caching/health.svg)

```
[![Health](https://phpackages.com/badges/quintype-caching/health.svg)](https://phpackages.com/packages/quintype-caching)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
