* libs/web: Changed caching behaviour of template library

This commit is contained in:
Steven Barth 2008-06-23 23:03:38 +00:00
parent 623eb26486
commit cd0eaf0005

View file

@ -128,15 +128,12 @@ Template = luci.util.class()
-- Shared template cache to store templates in to avoid unnecessary reloading -- Shared template cache to store templates in to avoid unnecessary reloading
Template.cache = {} Template.cache = {}
setmetatable(Template.cache, {__mode = "v"})
-- Constructor - Reads and compiles the template on-demand -- Constructor - Reads and compiles the template on-demand
function Template.__init__(self, name) function Template.__init__(self, name)
if self.cache[name] then
self.template = self.cache[name] self.template = self.cache[name]
else
self.template = nil
end
-- Create a new namespace for this template -- Create a new namespace for this template
self.viewns = {} self.viewns = {}