Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request codegram#6 from codegram/memoize_assets
Browse files Browse the repository at this point in the history
Memoize assets (performance improvement)
  • Loading branch information
josepjaume committed Jul 26, 2011
2 parents 393e06f + b6bd76b commit 23cc0b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rack/webconsole/asset_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def js_code
private

def asset(file)
::File.read(::File.join(::File.dirname(__FILE__), '..', '..', '..', 'public', file))
@assets ||= {}
@assets[file] ||= ::File.read(::File.join(::File.dirname(__FILE__), '..', '..', '..', 'public', file))
end
end
end
Expand Down

0 comments on commit 23cc0b5

Please sign in to comment.