PHPackages                             venveo/craft-compress - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. venveo/craft-compress

ActiveCraft-plugin[File &amp; Storage](/categories/file-storage)

venveo/craft-compress
=====================

Create smart zip files from Craft assets on the fly

5.0.0(1y ago)124.6k3[2 PRs](https://github.com/venveo/craft-compress/pulls)MITPHPPHP ^8.2|^9.0CI passing

Since Nov 2Pushed 1y ago3 watchersCompare

[ Source](https://github.com/venveo/craft-compress)[ Packagist](https://packagist.org/packages/venveo/craft-compress)[ RSS](/packages/venveo-craft-compress/feed)WikiDiscussions craft-5 Synced 1mo ago

READMEChangelog (8)Dependencies (3)Versions (14)Used By (0)

Compress plugin for Craft CMS (4.x-5.x)
=======================================

[](#compress-plugin-for-craft-cms-4x-5x)

Compress exposes a variable within Twig to create zip archives from Asset queries as a native Craft asset itself.

Features
--------

[](#features)

- Compress asset query into a zip file
- Generate "lazy links": will dispatch a queue job to generate archives, if a user clicks a link before the job is completed or started, the asset will be fetched on-demand and the queue job cancelled.
- Compressed archives are stored as Assets themselves, so you may query them just like other assets.
- Retrieve an asset query for the contents of an archive to show what files are contained in it.
- Automatically forces zip files to be regenerated when a dependent asset is deleted or updated in Craft.

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

[](#requirements)

- Craft CMS 3.x-5.x
- ext-zip PHP extension for creating zip files (also conveniently a Craft requirement)

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 venveo/craft-compress

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Compress.

Configuring Compress
--------------------

[](#configuring-compress)

1. Compress creates its archives as assets in Craft, so you'll need a place to put them. Create a new volume.
2. Click "Settings" next to the plugin in the plugin list and select a storage volume for archives. It's not recommended to use an existing volume. The volume must have URLs in order for the Twig helper to return download links; however, it will function without it and respect your settings and life choices.

Using Compress
--------------

[](#using-compress)

### Basic Example

[](#basic-example)

```
    {# Feel free to provide an array of assets if you prefer! #}
    {% set assets = craft.assets.volume('images') %}

    {#
    Second parameter is whether we want the archive generated on page
    load or lazily.
    #}
    {% set archive = craft.compress.zip(assets, true, 'My Photos') %}

    {#
    the archive variable is now set to an Archive model, but since
    we're in lazy mode, the getAsset() response may be null. We can
    either check the .isReady method or we can just get the lazyLink, which will give us an indirect link to the asset.
    #}
    {% if archive.isReady %}
        {% set archiveAsset = archive.getAsset() %}
        Download All Files
        {% else %}
        Download All Files
    {% endif %}

    {# We can get a new AssetQuery with the contents of the archive! #}
    {% set contents = archiveAsset.getContents().all() %}

    {% for file in contents %}
        {{ file.title }}
    {% endfor %}

```

### Advanced Example

[](#advanced-example)

This example gets all assets, groups them by the file type, and then generates a lazy link to download all assets of a particular kind.

```
{% set assets = craft.assets({
    volume: 'local'
}).all() %}

{% for kind, assetGroup in assets|group(a => a.kind) %}
    {% set archive = craft.compress.zip(assetGroup, true) %}
    {{ kind }} - Download All ({{ archive.isReady ? 'Ready' : 'Not ready' }})
    {% for asset in assetGroup %}
        {{ asset.filename }}
    {% endfor %}
{% endfor %}
```

Caveats &amp; Limitations
-------------------------

[](#caveats--limitations)

- Consider the Assets created by Compress to be temporary. Don't try to use them in Asset relation fields. set changes, a new archive asset will be created and the prior will not be automatically deleted.
- When you provide a name for your archive, it's a good idea to ensure that name is unique to the files you're zipping up. Failure to do so could result in the file not being cached well and being constantly overwritten.

Brought to you by [Venveo](https://www.venveo.com)

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 78.7% 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 ~298 days

Recently: every ~442 days

Total

7

Last Release

601d ago

Major Versions

1.0.3 → 4.0.02022-06-16

4.0.1 → 5.0.02024-09-24

PHP version history (2 changes)4.0.0PHP ^8.0.2|^9.0

5.0.0PHP ^8.2|^9.0

### Community

Maintainers

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

---

Top Contributors

[![Mosnar](https://avatars.githubusercontent.com/u/3810939?v=4)](https://github.com/Mosnar "Mosnar (48 commits)")[![jrm98](https://avatars.githubusercontent.com/u/2946458?v=4)](https://github.com/jrm98 "jrm98 (10 commits)")[![bymayo](https://avatars.githubusercontent.com/u/522877?v=4)](https://github.com/bymayo "bymayo (3 commits)")

---

Tags

compresscmsCraftcraftcmscraft-plugin

### Embed Badge

![Health badge](/badges/venveo-craft-compress/health.svg)

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

###  Alternatives

[superbig/craft3-beam

Generate CSVs and XLS files in your templates

1933.9k](/packages/superbig-craft3-beam)[servd/craft-remote-assets

Move CP assets to an external filesystem such as S3

1215.8k](/packages/servd-craft-remote-assets)[weareferal/remote-backup

Backup your database and assets to a remote location

115.5k](/packages/weareferal-remote-backup)[markdrzy/importable

Add CSV data import functionality to the native Table fieldtype.

114.6k2](/packages/markdrzy-importable)

PHPackages © 2026

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