PHPackages                             aelvan/stamp - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. aelvan/stamp

AbandonedCraft-plugin[Utility &amp; Helpers](/categories/utility)

aelvan/stamp
============

A simple plugin for adding timestamps to filenames.

2.1.0(7y ago)2734.1k↓50%6[4 issues](https://github.com/aelvan/Stamp-Craft/issues)MITPHP

Since Aug 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/aelvan/Stamp-Craft)[ Packagist](https://packagist.org/packages/aelvan/stamp)[ RSS](/packages/aelvan-stamp/feed)WikiDiscussions craft3 Synced 1mo ago

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

Stamp for Craft
===============

[](#stamp-for-craft)

A tiny plugin for adding timestamp to filenames.

*This is the Craft 3.x version of Stamp, for the Craft 2.x version see the [master branch](https://github.com/aelvan/Stamp-Craft/tree/master).*

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

[](#requirements)

This plugin requires Craft CMS 3.0.0 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 aelvan/stamp

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

Usage
-----

[](#usage)

Use it like this:

```

```

Which results in:

```

```

The er() method takes a second parameter for setting the format of the output. Possible values are `file` (default), `folder`, `query` and `tsonly`.

Example with `folder`:

```

```

Result:

```

```

Example with `query`:

```

```

Result:

```

```

Example with `only`:

```
Timestamp is: {{ craft.stamp.er('/assets/build/js/scripts.js', 'only') }}

```

Result:

```
Timestamp is: 1399647655

```

Hashing option
--------------

[](#hashing-option)

The `craft.stamp.er()` method takes a third parameter for setting the algorithm of the output. Possible values are `ts` (default), and `hash`.

`ts` stands for timestamp and behaves as shown above. `hash` gets the CRC32 checksum of the file instead of the timestamp. It's useful for cases when you need your cache busting to be fully deterministic.

For example:

```

```

Result:

```

```

URL rewriting
-------------

[](#url-rewriting)

For methods `file` and `folder` you probably want to do some url rewriting. Below are some examples of how this can be done, adjust as needed for your server and project setup.

Apache:

```
# Rewrites asset versioning, ie styles.1399647655.css to styles.css.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)\.(\d{10})\.(js|css)$ $1.$3 [L]  # /assets/build/js/scripts.1399647655.js
# RewriteRule ^(.+)/(\d{10})/(.+)\.(js|css)$ $1/$3.$4 [L]  # /assets/build/js/1399647655/scripts.js

```

nginx:

```
location @assetversioning {
    rewrite ^(.+)\.[0-9]+\.(css|js)$ $1.$2 last;  # /assets/build/js/scripts.1399647655.js
    # rewrite ^(.+)/([0-9]+)/(.+)\.(js|css)$ $1/$3.$4 last;  # /assets/build/js/1399647655/scripts.js
}

location ~* ^/assets/.*\.(?:css|js)$ {
    try_files $uri @assetversioning;
    expires max;
    add_header Pragma public;
    add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}

```

Configuration
-------------

[](#configuration)

Stamp needs to know the public document root to know where your files are located. By default Stamp will use `@webroot`, but on some server configurations this is not the correct path. You can configure the path by creating a config file called `stamp.php` in your config folder, and adding the `publicRoot` setting.

#### Example

[](#example)

```
'publicRoot' => '/path/to/website/public/',

```

Changelog
---------

[](#changelog)

See [CHANGELOG.md](https://github.com/aelvan/Stamp-Craft/blob/craft3/CHANGELOG.md).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 93.3% 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 ~421 days

Total

2

Last Release

2781d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2675644?v=4)[André Elvan](/maintainers/aelvan)[@aelvan](https://github.com/aelvan)

---

Top Contributors

[![aelvan](https://avatars.githubusercontent.com/u/2675644?v=4)](https://github.com/aelvan "aelvan (14 commits)")[![brandonkelly](https://avatars.githubusercontent.com/u/47792?v=4)](https://github.com/brandonkelly "brandonkelly (1 commits)")

---

Tags

asset-revassetscraft2craft3craftcmscraftcms-pluginrevisiontimestampworkflowcmsCraftcraftcmscraft-plugintimestampasset\_rev

### Embed Badge

![Health badge](/badges/aelvan-stamp/health.svg)

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

###  Alternatives

[verbb/navigation

Create navigation menus for your site.

90683.7k17](/packages/verbb-navigation)[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[verbb/comments

Add comments to your site.

13753.1k](/packages/verbb-comments)[verbb/tablemaker

Create customizable and user-defined table fields.

40168.8k1](/packages/verbb-tablemaker)[supercool/tablemaker

Create customizable and user-defined table fields.

40141.7k](/packages/supercool-tablemaker)[pennebaker/craft-architect

CraftCMS plugin to generate content models from JSON/YAML data.

72148.5k5](/packages/pennebaker-craft-architect)

PHPackages © 2026

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