PHPackages                             weboftalent/imageeditpartialcachebust - 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. weboftalent/imageeditpartialcachebust

ActiveSilverstripe-module[Caching](/categories/caching)

weboftalent/imageeditpartialcachebust
=====================================

Simplify partial caching queries for folders of DataObjects associated with Images by cache busting these DataObjects when the associated image is edited

1.0.0(10y ago)4232[1 PRs](https://github.com/gordonbanderson/weboftalent-imageeditpartialcachebust/pulls)PHP

Since Jun 12Pushed 10y ago1 watchersCompare

[ Source](https://github.com/gordonbanderson/weboftalent-imageeditpartialcachebust)[ Packagist](https://packagist.org/packages/weboftalent/imageeditpartialcachebust)[ RSS](/packages/weboftalent-imageeditpartialcachebust/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

\##Partial Cache Busting After Image Editing [![Build Status](https://camo.githubusercontent.com/bcebff2d986970e5f7414ad93ab570ba6d7d9b4968b4615362af4b0e8910cde0/68747470733a2f2f7472617669732d63692e6f72672f676f72646f6e62616e646572736f6e2f7765626f6674616c656e742d696d616765656469747061727469616c6361636865627573742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/gordonbanderson/weboftalent-imageeditpartialcachebust)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/727fa409fa5e2581d6e6f041825b450d360508437ae4c1ace663b0bdcbfa4d0b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676f72646f6e62616e646572736f6e2f7765626f6674616c656e742d696d616765656469747061727469616c6361636865627573742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gordonbanderson/weboftalent-imageeditpartialcachebust/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/381efd37ffe8e73e736eaff51a6258e5adb45a457e8b9ecdaeabc6b6d89ec3bf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676f72646f6e62616e646572736f6e2f7765626f6674616c656e742d696d616765656469747061727469616c6361636865627573742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gordonbanderson/weboftalent-imageeditpartialcachebust/?branch=master)[![Build Status](https://camo.githubusercontent.com/2b0e4bc12154e71fc3fdb7e20fa74b033b3b5e930ddfb9d70635a68e5c1263a7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676f72646f6e62616e646572736f6e2f7765626f6674616c656e742d696d616765656469747061727469616c6361636865627573742f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gordonbanderson/weboftalent-imageeditpartialcachebust/build-status/master)[![codecov.io](https://camo.githubusercontent.com/4fa3751abf26508c5f7827fb5dd351621301a2bdc9c9a45d1980f3112ccf794f/68747470733a2f2f636f6465636f762e696f2f6769746875622f676f72646f6e62616e646572736f6e2f7765626f6674616c656e742d696d616765656469747061727469616c6361636865627573742f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/gordonbanderson/weboftalent-imageeditpartialcachebust?branch=master)

[![Latest Stable Version](https://camo.githubusercontent.com/1c25c5129774fa2fa82fd0cd3ede24f5624fd7aebd7f1a45f55ec70b32d4dac3/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6674616c656e742f696d616765656469747061727469616c6361636865627573742f76657273696f6e)](https://packagist.org/packages/weboftalent/imageeditpartialcachebust)[![Latest Unstable Version](https://camo.githubusercontent.com/7f3a1fec2a4c9a3e58e95650c34ab9f588ff114b2d8a76cb02fbc4363a59ff4f/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6674616c656e742f696d616765656469747061727469616c6361636865627573742f762f756e737461626c65)](//packagist.org/packages/weboftalent/imageeditpartialcachebust)[![Total Downloads](https://camo.githubusercontent.com/cdf7a27b093f16f1f54dbf733e061dcea34c014ebf998326fe8ed48c1c2b8e7f/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6674616c656e742f696d616765656469747061727469616c6361636865627573742f646f776e6c6f616473)](https://packagist.org/packages/weboftalent/imageeditpartialcachebust)[![License](https://camo.githubusercontent.com/5a116835cd0543a7aa792da7671ef33c79db868e3fc9f161fdde67c9631332ef/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6674616c656e742f696d616765656469747061727469616c6361636865627573742f6c6963656e7365)](https://packagist.org/packages/weboftalent/imageeditpartialcachebust)[![Monthly Downloads](https://camo.githubusercontent.com/b385ae809383a0fdcdfd5b8d6e8741e8fca6633c6f2768e26ed2e67f6e17476a/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6674616c656e742f696d616765656469747061727469616c6361636865627573742f642f6d6f6e74686c79)](https://packagist.org/packages/weboftalent/imageeditpartialcachebust)[![Daily Downloads](https://camo.githubusercontent.com/954c4a7f1359d039b1acc46ec121cc90c04f288fea13b05009aa98556f1fc880/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6674616c656e742f696d616765656469747061727469616c6361636865627573742f642f6461696c79)](https://packagist.org/packages/weboftalent/imageeditpartialcachebust)

[![Dependency Status](https://camo.githubusercontent.com/89607d615baf1845835f6b31f09882a324ff56b828c2151100a04df289152665/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f7765626f6674616c656e743a696d616765656469747061727469616c6361636865627573742f62616467652e737667)](https://www.versioneye.com/php/weboftalent:imageeditpartialcachebust)[![Reference Status](https://camo.githubusercontent.com/dde3397fd19c971135924895ecccfed51ada9ace3e0f30bc5402b50042c11c2a/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f7765626f6674616c656e743a696d616765656469747061727469616c6361636865627573742f7265666572656e63655f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/php/weboftalent:imageeditpartialcachebust/references)

[![codecov.io](https://camo.githubusercontent.com/021f58d1c59f8f79c1863eb1eea9cb514648ebf3f97d8ba45c78367d2fab7daa/68747470733a2f2f636f6465636f762e696f2f6769746875622f676f72646f6e62616e646572736f6e2f7765626f6674616c656e742d696d616765656469747061727469616c6361636865627573742f6272616e63682e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/021f58d1c59f8f79c1863eb1eea9cb514648ebf3f97d8ba45c78367d2fab7daa/68747470733a2f2f636f6465636f762e696f2f6769746875622f676f72646f6e62616e646572736f6e2f7765626f6674616c656e742d696d616765656469747061727469616c6361636865627573742f6272616e63682e7376673f6272616e63683d6d6173746572)

This module enables the updating of the LastEdited value of DataObjects associated with Images being edited. This simplifies partial caching of for example the rendering of a folder of pages which are each represented by an image. If the cache key is based on the LastEdited value of the DataObjects in the folder, then when an image is edited (e.g. refocused with the FocusPoint module) the change will not show, as the cache key knows nothing about the LastEdited field of the images of child pages.

The options to ensure image updates show in the above scenario when using partial caching are these:

- Use max(LastEdited) of *all* images - inefficient
- Have a parital cache query around each child page checking for the LastEdited field of the page's image. This is also inefficient as one database query is made per child page rendered.
- Add a method in the folder object to calculate the cache key based on a database join query.

At the expense of a slightly more expensive write, we can use the LastEdited date of the child pages as a cache key that will also take into account image edits.

\##Configuration The classes to check for image IDs are configured as follows, in an arbitrarily named .yml file under any module's \_config directory, e.g. imageeditpartialcachebust.yml. There are three keys under 'ImageEditCacheBust'

- Stages: the stages configured in your default configuration, the default being Stage and Live
- SiteTree: a nested array of ClassName mapped to the field containing the image ID.
- DataObject: a nested array of ClassName mapped to the field containing the image ID.

In the example below every time an image is refocussed every PageWithImage data object will have it's LastEdited field updated to now (thus busting fragment caches) if the value of MainImageID matches the ID of the image being edited. Similarly with both SlidePage and Staff, except this time checking the PhotoID field.

```
---
Name: imageeditpartialcachebuster
After: framework/routes#coreroutes
---

ImageEditCacheBust:
  Stages: ['Stage','Live']
  SiteTree:
    PageWithImage : 'MainImageID'
    Product : 'ImageID'
    SlidePage : 'PhotoID'
    Staff : 'PhotoID'
  DataObject:
    GalleryImage : 'ImageID'

```

\##Template Example Using the module mentioned in the related modules section below, an example template for a folder containing several PageWithImage pages rendering their images looks like this:

```

$BreadCrumbs
$Title
$Content

$Title

$Form
$PageComments

```

\#Related Modules The cachkey helper module, , enables all partial cache key values to be accessed in a single database query, vastly reducing the number of queries performed when checking for partial cache validity.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

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 ~220 days

Total

2

Last Release

3772d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9af58f7ff675f65dbd2f20d39d8b80ed671eb0fe376eb978e497934c175196fe?d=identicon)[weboftalent](/maintainers/weboftalent)

---

Top Contributors

[![gordonbanderson](https://avatars.githubusercontent.com/u/7060?v=4)](https://github.com/gordonbanderson "gordonbanderson (8 commits)")

---

Tags

silverstripecachingtemplatespartials

### Embed Badge

![Health badge](/badges/weboftalent-imageeditpartialcachebust/health.svg)

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

###  Alternatives

[silverstripe/staticpublishqueue

Static publishing queue to create static versions of pages for enhanced performance and security

45135.4k4](/packages/silverstripe-staticpublishqueue)[tractorcow/silverstripe-dynamiccache

FORK OF Silverstripe module for simple on the fly caching of dynamic content

3916.0k2](/packages/tractorcow-silverstripe-dynamiccache)[pstaender/silverstripe-redis-cache

Enables Redis cache for SilverStripe

1199.1k](/packages/pstaender-silverstripe-redis-cache)[silverstripe-terraformers/keys-for-cache

Silverstripe cache key management

1726.6k](/packages/silverstripe-terraformers-keys-for-cache)[steadlane/silverstripe-cloudflare

This module aims to relieve the stress of using Cloudflare caching with any SilverStripe project. Adds extension hooks that clears Cloudflare's cache for a specific page when that page is published or unpublished.

243.7k](/packages/steadlane-silverstripe-cloudflare)

PHPackages © 2026

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