Skip to content

Commit

Permalink
Use Amber::Pipe::Static handler to set http response cache headers
Browse files Browse the repository at this point in the history
Enables caching of static files in `public/` dir which
will improve page load time and prevent delays in applying css/js to the
dom.

https://devcenter.heroku.com/articles/increasing-application-performance-with-http-cache-headers
  • Loading branch information
veelenga committed Aug 11, 2017
1 parent f0614c3 commit 9d44f9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/routes.cr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Amber::Server.instance.config do |app|

# All static content will run these transformations
pipeline :static do
plug HTTP::StaticFileHandler.new("./public")
plug Amber::Pipe::Static.new("./public")
plug HTTP::CompressHandler.new
end

Expand Down

0 comments on commit 9d44f9f

Please sign in to comment.