Leverage browser caching


#1

Google PageSpeed recommends that I “leverage browser caching” for my CSS by “setting a maximum age in the HTTP headers.” How does one do this with Jekyll?


#2

The good news is there are a bunch of options and resources available to you since what you want to do isn’t specific to Jekyll.

Depending on the server type you’re using to host your site this will vary, but if you’re using Apache you can set caching headers via a .htaccess file.

HTML5 Boilerplate has a really good one that is heavily commented that walks through all kinds of good things you’ll want to enable for improved performance (gzip compression, etc.) and security.


#3

Thanks! Now I’m trying to figure out how to do this without .htaccess since I’m using nginx.


#4

They also have server configs for nginx


#5

@mmistakes Thanks! I also found this: