Commit bcfbcdb4

mo khan <mo@mokhan.ca>
2013-12-29 02:40:27
cache the sitemap.
1 parent 3397f3b
Changed files (1)
app
app/controllers/sitemap_controller.rb
@@ -6,6 +6,8 @@ class SitemapController < ApplicationController
     @tutorials = Tutorial.all
     @base_url = "https://#{request.host_with_port}"
     headers['Content-Type'] = 'application/xml'
+    expires_in(1.hour)
+    fresh_when(@creations) if @creations.any?
     respond_to do |format|
       format.xml
     end