Sha256: dc76daf67956b23a93dfb6c6e43eb8ff811daa2df18422e5a3d4d3cdbdcf54ba
Contents?: true
Size: 906 Bytes
Versions: 5
Compression:
Stored size: 906 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 served 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 served from request cycle cache render json: users.to_json end def different_headers User.find(1) # first request user = User.options(headers: { 'Authentication' => 'Bearer 123' }).find(1) # second request that should NOT be served from request cycle cache as the headers are different render json: user.to_json end end
Version data entries
5 entries across 5 versions & 1 rubygems