Class: RailsAppcache::ManifestsController

Inherits:
ApplicationController show all
Includes:
ApplicationHelper
Defined in:
app/controllers/rails_appcache/manifests_controller.rb

Instance Method Summary collapse

Methods included from ApplicationHelper

#appcache_manifest_path, #appcache_version_string, #asset_cache_path, #javascript_cache_path, #stylesheet_cache_path

Instance Method Details

#showObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/rails_appcache/manifests_controller.rb', line 7

def show
  if params[:version] == appcache_version_string
    # This is a request from a current version of the page
    render params[:manifest]
  else
    # This is a request from an obsolete page, using an obsolete manifest
    # Serving a 404 enough to trigger an obsoletion event, which is purge
    # the manifest from the appcache.
    #
    # The client will get the correct version on the *next* page request
    display_404
  end
end