simpixelated / san-diego-downtown-mobility-plan

Advocacy for the San Diego Downtown Mobility Plan
http://simpixelated.github.io/san-diego-downtown-mobility-plan/
MIT License
0 stars 0 forks source link

cache busting #21

Open simpixelated opened 8 years ago

simpixelated commented 8 years ago

Caching The Gatsby Blog Starter Kit doesn’t support good caching practices by default. You can fix that by adding a cache buster to your HTML React component (html.js in the root directory). Then you can tell your host that bundle.js or style.css should be cached by browsers for a long time.

// outside the HTML component
const now = new Date();
const buster = now.getTime();
// inside its render() method
<script src={`/bundle.js?t=${buster}`}/>

https://blog.scottnonnenberg.com/practical-gatsby-js/