PHPackages                             chewett/cache-n-crunch - 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. chewett/cache-n-crunch

ActiveLibrary[Caching](/categories/caching)

chewett/cache-n-crunch
======================

Asset management and php caching system using uglifyjs for javascript assets

v0.5.3(7y ago)1137MITPHP

Since Mar 10Pushed 7y ago1 watchersCompare

[ Source](https://github.com/chewett/cache-n-crunch)[ Packagist](https://packagist.org/packages/chewett/cache-n-crunch)[ RSS](/packages/chewett-cache-n-crunch/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (11)Versions (24)Used By (0)

cache-n-crush
=============

[](#cache-n-crush)

**Please note: This is a custom caching framework designed both to play around with using uglify js and uglify css, and to be used for a custom website not suited for standard caching systems. In production you probably will want to use other caching frameworks such as assetic.**

Version 0.1 was a proof of concept to test if it worked. Since this does indeed appear to work im going to rework it to fill a number of potential objectives:

- Ability to state which files you want to crunch and load
- One file will be produced per set of crunch files. If you crunch A, B, and A+B they will exist as 3 separate crunch files
- The output of crunch A and B will not be used for A and B, and will be completely separate
- If the combined crunch is not available on the filesystem an exception will be thrown
- In debug mode the raw files will be loaded instead of the crunched file
- In debug mode, every time the raw files are loaded they are crunched
    - These crunched files will be saved as a new revision and will allow easy deployment calling the specific crunch method
    - When crunching files manually it will check for these new cached files and use them if present to speed up cache deployment
    - Some way to know which crunched files have new revisions you could deploy
- CSS files will be supported to merge css into a single file
- Uglify css will need to be ported over similarly to uglify js
    - maybe add some kind of similar interface, etc?
    - maybe allow any kind of crunching software to be plugged in?
- Store a list of previously crunched files, and their current file somewhere "nice"
    - Allow a user to recrunch everything if its changed using above store
    - Allow marking a crunch as "stale" after a file has been removed from the filesystem
    - Some way to view this potentially?
- Have some basic versioning of crunched files

Current Issues
--------------

[](#current-issues)

Possible implementation
-----------------------

[](#possible-implementation)

- JSON store to store all the data about the files
- Then export this to a basic php array file used for the main cache
- JSON file stores all the details such as new files, etc
- Each time the cache is modified json file is written out as a php file that works as the bootstrap

TODO:
-----

[](#todo)

- Remove all comments but allow custom comments at the top of the file configurable
- Allow getting the details of all previously crushed files and their constitutent paths
- Allow crushing by identifier (using the details of the constituent parts)
- Allow checking of identifiers to find what hasnt yet been updated (has changes in constituent files)
- Comment all code
- Comment all tests
- Write some more tests
- Create an example implementation repo?
- Run speedtests on importing a json file and including the php file? (only used the PHP file including as I have made the assumptions that it will be faster, possibly not true?)

Usage
-----

[](#usage)

No documentation available currently

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

[](#installation)

No documentation available currently

Tests
-----

[](#tests)

No documentation available currently

License
-------

[](#license)

This is licensed under the MIT license. For more information see the [LICENSE](LICENSE) file.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

Recently: every ~12 days

Total

23

Last Release

2684d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1496922?v=4)[Christopher Hewett](/maintainers/chewett)[@chewett](https://github.com/chewett)

---

Top Contributors

[![chewett](https://avatars.githubusercontent.com/u/1496922?v=4)](https://github.com/chewett "chewett (79 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/chewett-cache-n-crunch/health.svg)

```
[![Health](https://phpackages.com/badges/chewett-cache-n-crunch/health.svg)](https://phpackages.com/packages/chewett-cache-n-crunch)
```

###  Alternatives

[beryllium/cachebundle

Provides an interface to Memcache for Symfony2 applications

32136.0k](/packages/beryllium-cachebundle)

PHPackages © 2026

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