<linkrel="alternate icon"type="image/png"href="../favicon-32x32.png"><styletype="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><bodyclass="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="sidebar"><divclass="sidebar-menu"role="button">☰</div><ahref='../cache_buster/index.html'><divclass='logo-container rust-logo'><imgsrc='../rust-logo.png'alt='logo'></div></a><pclass="location">Crate cache_buster</p><divclass="block version"><p>Version 0.2.0</p></div><divclass="sidebar-elems"><aid="all-types"href="all.html"><p>See all cache_buster's items</p></a><divclass="block items"><ul><li><ahref="#reexports">Re-exports</a></li><li><ahref="#modules">Modules</a></li><li><ahref="#constants">Constants</a></li></ul></div><pclass="location"></p><divid="sidebar-vars"data-name="cache_buster"data-ty="mod"data-relpath="../"></div></div></nav><divclass="theme-picker"><buttonid="theme-picker"aria-label="Pick another theme!"aria-haspopup="menu"><imgsrc="../brush.svg"width="18"height="18"alt="Pick another theme!"></button><divid="theme-choices"role="menu"></div></div><scriptsrc="../theme.js"></script><navclass="sub"><formclass="search-form"><divclass="search-container"><div><selectid="crate-search"><optionvalue="All crates">All crates</option></select><inputclass="search-input"name="search"disabledautocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"></div><buttontype="button"class="help-button">?</button>
<aid="settings-menu"href="../settings.html"><imgsrc="../wheel.svg"width="18"height="18"alt="Change settings"></a></div></form></nav><sectionid="main"class="content"><h1class="fqn"><spanclass="in-band">Crate <aclass="mod"href="">cache_buster</a></span><spanclass="out-of-band"><spanid="render-detail"><aid="toggle-all-docs"href="javascript:void(0)"title="collapse all docs">[<spanclass="inner">−</span>]</a></span><aclass="srclink"href="../src/cache_buster/lib.rs.html#7-76"title="goto source code">[src]</a></span></h1><divclass="docblock"><h1id="what-is-cache-busting"class="section-header"><ahref="#what-is-cache-busting">What is cache busting?</a></h1>
<p>To optimise network load time, browsers cache static files. Caching
greatly improves performance but how do you inform browsers to
invalidate cache when your files have changed?</p>
<p>Cache busting is a simple but effective solution for this issue. There
are several ways to achieve this but the way this library does this is
by changing file names to include the hash of the files’ contents.</p>
<p>So if you have <code>bundle.js</code>, it will become
<code>bundle.<long-sha256-hash>.js</code>. This lets you set a super long cache age
as, because of the file names changing, the path to the filename, too,
will change. So as far as the browser is concerned, you are trying to load
a file that it doesn’t have. Pretty neat, isn’t it?</p>
<table><tr><td><code>pub use processor::<aclass="struct"href="../cache_buster/processor/struct.BusterBuilder.html"title="struct cache_buster::processor::BusterBuilder">BusterBuilder</a>;</code></td></tr><tr><td><code>pub use filemap::<aclass="struct"href="../cache_buster/filemap/struct.Files.html"title="struct cache_buster::filemap::Files">Files</a>;</code></td></tr></table><h2id="modules"class="section-header"><ahref="#modules">Modules</a></h2>
<table><trclass="module-item"><td><aclass="constant"href="constant.CACHE_BUSTER_DATA_FILE.html"title="cache_buster::CACHE_BUSTER_DATA_FILE constant">CACHE_BUSTER_DATA_FILE</a></td><tdclass="docblock-short"><p>file to which filemap is written during compilation