[][src]Crate rocket_static_files

rocket-static-files is a simple (but still very rough) way to add caching headers to your static files served by Rocket. Obviously you should use a real HTTP server like nginx or apache, but since you're here, you clearly don't want to.

The headers are added in three steps:

  1. First, rocket-static-files scans your static files directory, generating a hash for each file, as part of your build script.
  2. You add a fairing to your Rocket, replacing rocket_contrib's serve fairing if you're using it.
  3. You update your HTML to link to StaticFiles::to instead of directly to the path.

If all goes according to plan, your links will look something like: /static/some_file.png?v=H8y4bzqH6Mg. When you change your static file and recompile, you'll get a new value for v.



Entry point for all of the functionality for rocket-static-files.