2017 © Pedro Peláez
 

library tcc-cache-buster

TccCacheBuster Package

image

tccltd/tcc-cache-buster

TccCacheBuster Package

  • Thursday, July 2, 2015
  • by shipleyr
  • Repository
  • 3 Watchers
  • 0 Stars
  • 42 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

TccCacheBuster Module

This module automatically inserts a version number into the head links and head scripts you have on your pages. The version number is pulled from the applicaiton config., (*1)

return [
    'version' => '1.1.1',
];

This will lead to a head link like /css/my-css-file.1.1.1.css, (*2)

If you don't specify a version number nothing happens so can be used in development and then the buildscript for a production environment can insert a config file into the applications config/autoload directory., (*3)

A minor addition needs to be made to the apache .htaccess file to allow this to work using ModRewrite..., (*4)

# Capture version bumping of files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.([0-9]+\.[0-9]+\.[0-9]+)\.(js|css|png|jpg|gif)$ /$1.$3 [L]

(Note: With the above you can also version images but this module does not automatically do this)., (*5)

Why do I need this?

If you web server is set to cache js/css files in a users browser and you release a new version the browser will pull files from cache rather than download new version from the server., (*6)

By altering the version number of the file requested the browser downloads a new version from the server when the files have changed., (*7)

The Versions

02/07 2015

dev-master

9999999-dev

TccCacheBuster Package

  Sources   Download

The Requires

 

02/07 2015

1.1.1

1.1.1.0

TccCacheBuster Package

  Sources   Download

The Requires

 

01/07 2015

1.1.0

1.1.0.0

TccCacheBuster Package

  Sources   Download

The Requires

 

21/05 2015

1.0.0

1.0.0.0

TccCacheBuster Package

  Sources   Download

The Requires