Sha256: f7620078655a41551232c19ac3843a7c8b09d164938a3a4a12de5493e345d779

Contents?: true

Size: 640 Bytes

Versions: 30

Compression:

Stored size: 640 Bytes

Contents

require 'rubygems'
require 'ramaze'

class MainController < Ramaze::Controller
  map '/'
  helper :cache

  def index
    @number = rand * 100

%q[
<html>
  <head><title>examples/caching</title></head>
  <body>
    <p>
      This action just shows you a random number: #{@number}.<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

  cache_action :method => 'index'

  def invalidate
    Ramaze::Cache.action.delete('/')
    redirect :/
  end
end

Ramaze.start

Version data entries

30 entries across 30 versions & 4 rubygems

Version Path
ramaze-2023.01.06 examples/helpers/cache.rb
Pistos-ramaze-2009.06.12 examples/helpers/cache.rb
manveru-ramaze-2009.05.08 examples/helpers/cache.rb
manveru-ramaze-2009.05 examples/helpers/cache.rb
manveru-ramaze-2009.06.04 examples/helpers/cache.rb
manveru-ramaze-2009.06.12 examples/helpers/cache.rb
manveru-ramaze-2009.06 examples/helpers/cache.rb
manveru-ramaze-2009.07 examples/helpers/cache.rb
rjspotter-ramaze-2009.06.29 examples/helpers/cache.rb
rjspotter-ramaze-2009.06.31 examples/helpers/cache.rb
ramaze-2012.12.08 examples/helpers/cache.rb
ramaze-2012.12.08b examples/helpers/cache.rb
ramaze-2012.04.14 examples/helpers/cache.rb
ramaze-2012.03.07 examples/helpers/cache.rb
ramaze-2011.12.28 examples/helpers/cache.rb
ramaze-2011.10.23 examples/helpers/cache.rb
ramaze-2011.07.25 examples/helpers/cache.rb
ramaze-2011.01.30 examples/helpers/cache.rb
ramaze-2011.01 examples/helpers/cache.rb
ramaze-2010.06.18 examples/helpers/cache.rb