Netflix / fast_jsonapi

No Longer Maintained - A lightning fast JSON:API serializer for Ruby Objects.
Apache License 2.0
5.07k stars 425 forks source link

Cache not updating #431

Open maxrosecollins opened 5 years ago

maxrosecollins commented 5 years ago

I have caching enabled

cache_options enabled: true, cache_length: 1.hour

and on the model I have the method

def cache_key
    "#{model_name.cache_key}/#{id}-#{updated_at.to_i}"
  end

but my object doesn't update/clear the cache after an hour.

Is it stored in Redis? When I clear the redis cache it doesn't update either. I have the option config.cache_store = :redis_cache_store set in config production

dainmiller commented 5 years ago

What if you change the cache_key to remove the model_name.cache_key/ and just leave the latter half of the key? Does that still result in same behavior?

Also, is this a model that has a lot of relationships to other models, or fairly stand-alone?