Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Latest commit

 

History

History

cache-buster

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Cache Buster

This is used to help cache bust browser url requests, such as when importing fonts with @font-face.

cache-buster()

Parameters

$seed [Number]

Default: 9999999999

This number is used to generate a random hash - higher is better

$separator [String]

Default: ?

Used to attach the seed number to the URL.

Note: If the url already has a query string on it, you may want to consider changing this to an ampersand & so the cache-buster isn't interfering with any other of the queries.

Usage

.element {
    background-image: url('image.png' + cache-buster());
}

Output

.element {
    background-image: url('image.png?912932');
}