Started GET "/api/shops/1" for 71.237.193.222 at 2016-06-21 15:44:34 -0700
Processing by Api::ShopsController#show as HTML
Parameters: {"id"=>"1"}
Shop Load (0.6ms) SELECT `shops`.* FROM `shops` WHERE `shops`.`id` = 1 LIMIT 1
Couldn't find template for digesting: shops/show
[active_model_serializers] Cache read: shops/1-20160621220542000000000/attributes ({:expires_in=>1 day, :skip_digest=>true})
[active_model_serializers] Cache fetch_hit: shops/1-20160621220542000000000/attributes ({:expires_in=>1 day, :skip_digest=>true})
[active_model_serializers] User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
[active_model_serializers] Provider Load (0.4ms) SELECT `providers`.* FROM `providers` WHERE `providers`.`id` = 5 LIMIT 1
[active_model_serializers] Rendered ShopsShowSerializer with ActiveModelSerializers::Adapter::Attributes (193.61ms)
Completed 200 OK in 470ms (Views: 186.7ms | ActiveRecord: 64.1ms)
I have been researching this for awhile now. With GET requests to my JSON api I am seeing these in the logs. Any ideas?
How are you calling render? Are you using the cache-digest gem or anything? This isn't coming from AMS
No, I am not. I am just using this for example:
def show
respond_with @shop, serializer: ShopsShowSerializer if stale?(@shop)
end
and...
class ShopsSerializer < ActiveModel::Serializer
cache expires_in: 1.day, skip_digest: true
attributes :id
end
@chrishough it's mentioned in http://www.akitaonrails.com/2016/03/23/improving-your-microservices-integration-performance-with-memcache-and-etags seems to be a result of if stale?(@shop) that is okay
@chrishough would you consider this resolved, that it's a non-Rails, non-AMS warning that can be ignored?
Closing due to lack of submitter response.
Sorry for the delay, I have a list of these issues I need to get back to. The issue has disappeared magically for now. I would consider this closed and will re-post if it pops back up.
Great!
This isn't an AMS issue (at least for me), but just adding details here because this is the best search hit for the error.
I was getting this for an API-only JSON endpoint:
class FooController < ApplicationController
def bar
if stale?(bar)
respond_to do |format|
format.json do
render json: bar
end
end
end
end
end
Was processing OK, but giving me an error in the logs:
Couldn't find template for digesting: foo/bar
I noticed that the docs for stale? say:
:templateBy default, the template digest for the current controller/action is included in ETags. If the action renders a different template, you can include its digest instead. If the action doesn't render a template at all, you can passtemplate: falseto skip any attempt to check for a template digest.
So I updated my stale? check to:
if stale(etag: bar, last_modified: bar.updated_at, template: false)
And it no longer logs the error