I have the case when I use Datatable for 2-5 minutes over it's will show errors "Failed to load resource: the server responded with a status of 502 ()".
It seems a caching when I clear all caching in a browser it's ok but after 2-5 minutes it comes again.
Currently, I'm using caching local below
For this action in the controller
def index
@page_title = 'Deals'
#limit record for user
deals = Deal.cached_all.accessible_by(current_ability)
@datatable = Crm::DealsDatatable.new(deals: deals)
#caching
#fresh_when etag: @datatable
end
And this is a collection in datatable :
collection do
scope = attributes[:deals].includes(:company, :user, :sales_unit, :contact, :deal_status, :consultant_company, :contractor_company, :enduser_company, :competitor_company, :responsible, :submited, :observer) if attributes[:deals]
scope
end
I also change collection without caching with the information below but it does not solve the problem.
collection do
scope = Deal..includes(:company, :user, :sales_unit, :contact, :deal_status, :consultant_company, :contractor_company, :enduser_company, :competitor_company, :responsible, :submited, :observer) if attributes[:deals]
scope
end
Dear all,
I have the case when I use Datatable for 2-5 minutes over it's will show errors "Failed to load resource: the server responded with a status of 502 ()".
It seems a caching when I clear all caching in a browser it's ok but after 2-5 minutes it comes again.
Currently, I'm using caching local below
For this action in the controller
And this is a collection in datatable :
I also change collection without caching with the information below but it does not solve the problem.
Please give me some idea about this issue.
Thank you so much.