Sha256: 2b4127cd14101c5d39b9fe653d4add2a44e27c0032f0d0b9aa7cd105730cc29f

Contents?: true

Size: 591 Bytes

Versions: 21

Compression:

Stored size: 591 Bytes

Contents

require 'rubygems'
require 'ramaze'

class MainController < Ramaze::Controller
  map :/

  helper :cache
  cache :index

  def index
%[
<html>
  <head><title>examples/caching</title></head>
  <body>
    <p>
      This action just shows you a random number: #{rand * 100}.<br />
      If you <a href="/">refresh</a> the page it won't change since you see a cached version.<br />
      But if you <a href="/invalidate">invalidate</a> it, the page will be regenerated.
    </p>
  </body>
</html>
]
  end

  def invalidate
    action_cache.delete '/index'
    redirect :/
  end
end

Ramaze.start

Version data entries

21 entries across 21 versions & 5 rubygems

Version Path
Pistos-ramaze-2008.09 examples/helpers/cache.rb
Pistos-ramaze-2008.12 examples/helpers/cache.rb
Pistos-ramaze-2009.01 examples/helpers/cache.rb
Pistos-ramaze-2009.02 examples/helpers/cache.rb
clivecrous-ramaze-0.3.9.5 examples/caching.rb
manveru-ramaze-2008.07 examples/helpers/cache.rb
manveru-ramaze-2008.08 examples/helpers/cache.rb
manveru-ramaze-2008.09 examples/helpers/cache.rb
manveru-ramaze-2008.10 examples/helpers/cache.rb
manveru-ramaze-2008.12 examples/helpers/cache.rb
manveru-ramaze-2009.01 examples/helpers/cache.rb
ptomato-ramaze-2009.02.1 examples/helpers/cache.rb
ptomato-ramaze-2009.02 examples/helpers/cache.rb
ramaze-0.3.5 examples/caching.rb
ramaze-2008.06 examples/helpers/cache.rb
ramaze-2009.01 examples/helpers/cache.rb
ramaze-0.3.9.1 examples/caching.rb
ramaze-0.3.9 examples/caching.rb
ramaze-2008.11 examples/helpers/cache.rb
ramaze-2009.02 examples/helpers/cache.rb