Sha256: de9bdecab9fae20c5252bed6f2e3c8d9227e3564da1e7a28743703f14e7c2ef2

Contents?: true

Size: 913 Bytes

Versions: 12

Compression:

Stored size: 913 Bytes

Contents

# frozen_string_literal: true

class RequestCycleCacheController < ApplicationController
  def simple
    User.find(1) # first request
    user = User.find(1) # second request that should be serverd from request cycle cache
    render json: user.to_json
  end

  def no_caching_interceptor
    User.options(interceptors: []).find(1) # first request
    user = User.options(interceptors: []).find(1) # second request
    render json: user.to_json
  end

  def parallel
    User.find(1, 2) # first request
    users = User.find(1, 2) # second request that should be serverd from request cycle cache
    render json: users.to_json
  end

  def headers_are_different
    User.find(1) # first request
    user = User.options(headers: { 'Authentication' => 'Bearer 123' }).find(1) # second request that should NOT be serverd from request cycle cache as the headers are different
    render json: user.to_json
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dhs-1.6.0 spec/dummy/app/controllers/request_cycle_cache_controller.rb
dhs-1.5.0 spec/dummy/app/controllers/request_cycle_cache_controller.rb
dhs-1.4.2 spec/dummy/app/controllers/request_cycle_cache_controller.rb
dhs-1.4.1 spec/dummy/app/controllers/request_cycle_cache_controller.rb
dhs-1.4.0 spec/dummy/app/controllers/request_cycle_cache_controller.rb
dhs-1.3.0 spec/dummy/app/controllers/request_cycle_cache_controller.rb
dhs-1.2.0 spec/dummy/app/controllers/request_cycle_cache_controller.rb
dhs-1.1.0 spec/dummy/app/controllers/request_cycle_cache_controller.rb
dhs-1.0.3 spec/dummy/app/controllers/request_cycle_cache_controller.rb
dhs-1.0.2 spec/dummy/app/controllers/request_cycle_cache_controller.rb
dhs-1.0.1 spec/dummy/app/controllers/request_cycle_cache_controller.rb
dhs-1.0.0 spec/dummy/app/controllers/request_cycle_cache_controller.rb