AOEpeople/Aoe_JsCssTstamp

Name: Aoe_JsCssTstamp

Owner: AOE

Description: Automatic Versioning of JS and CSS files for Magento

Created: 2012-04-25 19:07:39.0

Updated: 2017-09-29 10:14:36.0

Pushed: 2017-08-18 14:13:22.0

Homepage: http://www.fabrizio-branca.de/automatisches-versionieren-von-javascript-und-css-dateien-in-magento.html

Size: 261

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

AOE_JsCssTimestamp

Build Status

Author: Fabrizio Branca

Overview

This module adds the last-modified timestamp to your JS and CSS merged files to enabled browser-based caching and speed up your server.

Installation

Add following lines to your .htaccess file if storage is set to “database” and you are using apache as your web server.

Get merged js and css files from database using get.php if they do not exist in filesystem

iteCond %{REQUEST_URI} ^/media/css/.*\.css$ [OR]
iteCond %{REQUEST_URI} ^/media/js/.*\.js$

never rewrite for existing files

iteCond %{REQUEST_FILENAME} !-f
iteRule .* ../get.php [L]
Add versions to files

If you enable one of the following in the configuration make sure to add this to your .htaccess file:

iteRule (.*)\.(\d{10})\.(gif|png|jpg)$ $1.$3 [L,NC]
iteRule (.*)\.(\d{10})\.(css)$ $1.$3 [L,NC]
iteRule (.*)\.(\d{10})\.(js)$ $1.$3 [L,NC]

If you use NGINX, add the following lines to your nginx config within the server block for your site if you use database as the file storage location:

tion ^~ /media/js/ {
try_files $uri $uri/ @handlerjs;


tion ^~ /media/css/ {
try_files $uri $uri/ @handlercss;


tion @handlerjs {
rewrite /media/js/ /get.php;


tion @handlercss {
rewrite /media/css/ /get.php;

If you enable the Add timestamps to asset files feature, also add these lines to your nginx config file

they should NOT be added to any particular location block.

ite "^/(.*)\.(\d{10})\.(gif|png|jpg)$" /$1.$3 last;
Release notes
v0.8.1 v0.8.0 v0.7.1 v0.7.0 v0.6.0

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.