client cache

The client cache is only client side? I mean it can’t be controled by the core? Like skip saving item’s cache ?

diff --git a/src/server/game/Handlers/AuthHandler.cpp b/src/server/game/Handlers/AuthHandler.cpp
index 880937c…c32a71d 100644
— a/src/server/game/Handlers/AuthHandler.cpp
+++ b/src/server/game/Handlers/AuthHandler.cpp
@@ -40,6 +40,6 @@ void WorldSession::SendAuthResponse(uint8 code, bool shortForm, uint32 queuePos)
void WorldSession::SendClientCacheVersion(uint32 version)
{
WorldPacket data(SMSG_CLIENTCACHE_VERSION, 4);

  • data << uint32(version);
  • data << uint32(rand());
    SendPacket(&data);
    }

IIRC this was posted somewhere on this forums a long time ago. Can’t manage to find the post though.

The idea behind it was to randomize the client cache version so that in every login it’s different and it triggers a client side regeneration, so you always get the “fresh” changes on it.

Alright thx for the tip /emoticons/default_smile.png

This could easily be made a config option and added to the core, if someone took the time to add the additional code and made a PR…

In fact, the version parameter of the method is a int config value which sets the version number.

Maybe it could be changed to a boolean config option to make people decide whether or not they want to force a client cache regeneration by randomizing the value or sending whichever value as usual (unless someone really makes other use of the current config option).

As in my example, a bolean config:

Cache.Version.Regenerate

Description: Regenerate a random client cache version

Cache.Version.Regenerate = 0
Should I PR?

Little fact: we change that cache version with each TDB release.

About your PRs, Shauren suggested to use the existing config cache version field: if it has the value -1, send time(nullptr) to the client (no problems like rand() returning the same value multiple times). The time(nullptr) will work till 2038 /emoticons/default_smile.png