You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed a potential issue when I was trying to debug a slow cache retrieval.
I accessed an instance of Contentful::Asset and called .file on it. The call returned a gigantic wall of text (longer than my console limit) which seemed entirely composed of references to other assets and entries in my contentful space. If these references are being cached / loaded, this could be a huge problem and maybe why my cache retrievals are slow.
Do you have any idea what this wall of references might be?
Using 2.13.3 of the gem
The text was updated successfully, but these errors were encountered:
0xStarcat
changed the title
Are @asset.file objects bloated?
Are Contentful::File instances bloated?
May 15, 2020
@0xStarcat Hello :) I've also been working recently on improving caching contentul data in our project. In our case, a big issue was that we had content that had self-references (i.e. a news article would have links to other news articles, which also linked news, etc.), and sometimes these unintentional "graphs" could grow to over 30MB of marshalled data :/
And of course it's hard to say what your output looks like without an example, but could it be that you're seeing the "ContentTypes" which are loaded automatically when you use "dynamic_entries: :auto"? If you have a big data model, those can look like a lot of data when you inspect the client.
I tried to parse my console output a bit more -- I can't pretty print it because it just goes off the end of my console screen! lol. It looks like the the big list of entries is under a key called :_entries_cache which is under a key :includes_for_single which is connected somehow to my gigantic file instances.
Hello,
I noticed a potential issue when I was trying to debug a slow cache retrieval.
I accessed an instance of
Contentful::Asset
and called.file
on it. The call returned a gigantic wall of text (longer than my console limit) which seemed entirely composed of references to other assets and entries in my contentful space. If these references are being cached / loaded, this could be a huge problem and maybe why my cache retrievals are slow.Do you have any idea what this wall of references might be?
Using
2.13.3
of the gemThe text was updated successfully, but these errors were encountered: