title: Rails cache saved files with wrong extension
body: <p>I have mime type defined </p>
  
  <pre><code>Mime::Type.register "text/html", :demo
  </code></pre>
  
  <p>and controller which looks like this:</p>
  
  <pre><code>  caches_page :show
    def show
      .....
      render_location
    end
  
    def render_location
      ...
      respond_to do |format|
        format.html {
          expires_in 3.days, :public=&gt;true
        }
        format.demo {
          headers['Content-type']  = 'text/html'
          render 'fields.html.erb', layout:nil
        }
        format.json do
          out = {
            :promo_text =&gt; 'text',
            :currencies =&gt; 'eee'
          }
          render json: out
        end
      end
    end
  </code></pre>
  
  <p>Route is set lite this:</p>
  
  <pre><code>get '/prefix/*place', to: 'locations#show', as: 'location', defaults: {format:'html'}
  </code></pre>
  
  <p>For some reason file in cache folder is saved with .demo extension even when I request for "prefix/some-place"</p>
  
  <p>I can't understand why this happens.</p>