PHPackages                             suhype/craft-pagecache - 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. suhype/craft-pagecache

ActiveCraft-plugin[Caching](/categories/caching)

suhype/craft-pagecache
======================

Simple HTML Page Cache Plugin

2.1.4(9mo ago)3269proprietaryPHPPHP ^8.2.0|^9.0

Since Jan 31Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/ammannbe/craft-pagecache)[ Packagist](https://packagist.org/packages/suhype/craft-pagecache)[ RSS](/packages/suhype-craft-pagecache/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (1)Versions (45)Used By (0)

Page Cache plugin for Craft CMS
===============================

[](#page-cache-plugin-for-craft-cms)

Simple but useful Page Cache Plugin.

With this plugin you can create static HTML files of your entries.

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.x or later.

Installation
------------

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

```
cd /path/to/project
```

2. Then tell Composer to load the plugin:

```
composer require suhype/craft-pagecache
```

3. In the Control Panel, go to *Settings* → *Plugins* and click the “Install” button for Page Cache.

Page Cache Overview
-------------------

[](#page-cache-overview)

Page Cache is a Craft CMS plugin which can create static HTML files of your entries.

Configuring Page Cache
----------------------

[](#configuring-page-cache)

Go to *Settings* → *Page Cache* to setup the basic configuration options:

- **Enabled caching**: Enable or disable the caching. Note: you need to delete the cache manually.
- **Enable gzip compression**: Serve gzip compressed cached files.
- **Enable brotli compression**: Serve brotli compressed cached files. Only works if the PHP brotli extension is installed.
- **When globals are saved**: Choose what happens when globals got saved. Choose between "Refresh cache" &amp; "Delete cache"
- **Excluded URL's**: Define URL's which should **never** be cached (regex possible).
- **Included URL's**: Define URL's which should **always** be cached (regex possible). This options overwrites the **Excluded URL's** option.
- **Cache folder path**: Define a custom path, where cached files should be stored. Aliases (like `@webroot`) allowed.

Add rewrite rules rules
-----------------------

[](#add-rewrite-rules-rules)

To speed up your page even more you can add rewrite rules for .htaccess, nginx and apache. You can use the examples for .htaccess (with and without gzip/brotli compression):

- [resources/rewrite-rules/.htaccess.example](resources/rewrite-rules/.htaccess.example)
- [resources/rewrite-rules/.htaccess.example.br](resources/rewrite-rules/.htaccess.example.br)
- [resources/rewrite-rules/.htaccess.example.gzip](resources/rewrite-rules/.htaccess.example.gzip)

The [brotli](resources/rewrite-rules/.htaccess.example.br) and [gzip](resources/rewrite-rules/.htaccess.example.gzip) compressions can be used together, separately or not at all. Just make sure to add them **before** the [normal rewrite rules](resources/rewrite-rules/.htaccess.example)

Using Page Cache
----------------

[](#using-page-cache)

- Go to *Settings* → *Page Cache*
- Enable caching and optionally customize the settings
- As soon as a user visits a page, it got's cached.
- Optional: go to *Entries*, mark all cachable entries (→ entries with URL's), and Choose *Refresh cache*

Delete Page Caches
------------------

[](#delete-page-caches)

- Go to *Utilities* → *Caches*
- Select *Page Cache*
- Click on *Clear caches*

Console commands
----------------

[](#console-commands)

Clear the whole page cache (this is the same as under *Utilities*):

```
php craft clear-caches/pagecache
```

Refresh cache:

```
# Run `php craft pagecache/refresh --help` to see the possible arguments

php craft pagecache/refresh
```

Page Cache Roadmap
------------------

[](#page-cache-roadmap)

Some things to do, and ideas for potential features:

- Add entry action to exclude entries
- Add config option to include URL's

Brought to you by [Benjamin Ammann](https://github.com/ammannbe)

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance67

Regular maintenance activity

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~27 days

Recently: every ~71 days

Total

42

Last Release

140d ago

Major Versions

0.2.2 → 1.2.22023-08-13

0.2.4 → 1.3.02025-02-10

1.3.1 → 2.0.12025-04-14

1.4.0 → 2.1.02025-05-02

1.4.1 → 2.1.12025-05-02

PHP version history (4 changes)1.0.0-beta.1PHP ^8.0.2|^9.0

0.0.1-beta.1PHP ^7.2.5

0.0.1-beta.3PHP ^7.2.5|^8.0.2

2.0.1PHP ^8.2.0|^9.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/de89aba852a703b7e96996d3f5c7a116062bdbef1bc84d6d813ae6278ec95047?d=identicon)[suhype](/maintainers/suhype)

---

Top Contributors

[![ammannbe](https://avatars.githubusercontent.com/u/26964239?v=4)](https://github.com/ammannbe "ammannbe (78 commits)")

---

Tags

cmsCraftcraftcmscraft-pluginpage cache

### Embed Badge

![Health badge](/badges/suhype-craft-pagecache/health.svg)

```
[![Health](https://phpackages.com/badges/suhype-craft-pagecache/health.svg)](https://phpackages.com/packages/suhype-craft-pagecache)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k69](/packages/verbb-formie)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)[verbb/hyper

A user-friendly links field for Craft.

24147.8k12](/packages/verbb-hyper)[mmikkel/cache-flag

Cold template caches that can be flagged and automatically invalidated.

1730.4k1](/packages/mmikkel-cache-flag)[verbb/social-poster

Automatically post entries to social media.

918.5k](/packages/verbb-social-poster)[verbb/events

A full-featured plugin for event management and ticketing.

2311.9k](/packages/verbb-events)

PHPackages © 2026

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