Module: Awestruct::Extensions::Cachebuster

Defined in:
lib/awestruct/extensions/cachebuster.rb

Instance Method Summary collapse

Instance Method Details

#cache(href) ⇒ Object



5
6
7
# File 'lib/awestruct/extensions/cachebuster.rb', line 5

def cache(href)
 "#{href}?#{cachebuster}"
end

#cachebuster(p = page) ⇒ Object



9
10
11
# File 'lib/awestruct/extensions/cachebuster.rb', line 9

def cachebuster(p=page)
 ((site.timestamp || p.input_mtime || Time.now.to_i) / 1000).to_i.to_s
end