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 2w 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 74% 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

1702d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8854520?v=4)[Quintype Technologies India Ltd](/maintainers/quintype)[@quintype](https://github.com/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

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[phpfastcache/phpssdb

PHP SSDB Driver for phpFastCache

14736.9k1](/packages/phpfastcache-phpssdb)

PHPackages © 2026

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