Does anyone know precisely how the cache works ?
I would like to know if there is a documentation about how the cache precisely works ?
In fact, I'd like to know what items are cached and when, for example: are channels cached immediately? If so is it at the time of the "ready" event or another? What about the tags for the forum channels? Are threads cached at startup?
My question is a bit vague but overall, I'd like to understand how caching works in detail so I'm interested in any documentation or I know that I can have an answer by looking in the source code but if you have any information it could same me some time
4 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
The only way to learn how caching works is to understand how the Discord Gateway (ws) works
In general, things are cached when a *_CREATE event is received, although there are other events when structures can become cached
Alright, I will check that thanks
The main questioning I had was when the bot was connecting to understand exactly what it was starting with in cache. I will come back to ask more questions based on the documentation you sent thanks I just read the whole documentation on Gateway and events and I still have 2 questions :
• In the guild create event, does the field "members" contains the array of ALL members in the guild regardless of quantity ?
• Same question for "channels" and "roles" field