Merge pull request #5318 from Matt-Yorkley/caching-api

[Caching] API Action Caching on shop filters
This commit is contained in:
Luis Ramos
2020-05-07 11:42:52 +01:00
committed by GitHub
6 changed files with 178 additions and 1 deletions

View File

@@ -1,11 +1,15 @@
module Api
class OrderCyclesController < Api::BaseController
include EnterprisesHelper
respond_to :json
include ApiActionCaching
skip_authorization_check
skip_before_filter :authenticate_user, :ensure_api_key, only: [:taxons, :properties]
caches_action :taxons, :properties,
expires_in: CacheService::FILTERS_EXPIRY,
cache_path: proc { |controller| controller.request.url }
def products
render_no_products unless order_cycle.open?