diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 31a2f57fd0..bca7d9c0bc 100755 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -39,6 +39,7 @@ #include #include #include "../newview/lggcontactsets.h" +#include "../llxml/llcontrol.h" namespace LLAvatarNameCache { @@ -762,22 +763,53 @@ void LLAvatarNameCache::insert(const LLUUID& agent_id, const LLAvatarName& av_na F64 LLAvatarNameCache::nameExpirationFromHeaders(const LLSD& headers) { - const F64 DEFAULT_EXPIRES = 60.0 * 60.0 + LLFrameTimer::getTotalSeconds(); - - F64 expires = 0.0; - if (expirationFromCacheControl(headers, &expires)) + // Optional legacy name cache expiration in case SL can't handle us... ;) + //F64 expires = 0.0; + //if (expirationFromCacheControl(headers, &expires)) + //{ + // return expires; + //} + //else + //{ + // // With no expiration info, default to an hour + // const F64 DEFAULT_EXPIRES = 60.0 * 60.0; + // F64 now = LLFrameTimer::getTotalSeconds(); + // return now + DEFAULT_EXPIRES; + //} + + static LLCachedControl use_legacy_namecache_expiration(*LLControlGroup::getInstance("Global"), "FSLegacyNameCacheExpiration"); + if (!use_legacy_namecache_expiration) { - //AO make sure cache expiration is at least 1HR - if (expires < DEFAULT_EXPIRES) {expires = DEFAULT_EXPIRES;} - return expires; + F64 expires = 0.0; + if (expirationFromCacheControl(headers, &expires)) + { + return expires; + } + else + { + // With no expiration info, default to an hour + const F64 DEFAULT_EXPIRES = 60.0 * 60.0; + F64 now = LLFrameTimer::getTotalSeconds(); + return now + DEFAULT_EXPIRES; + } } else { - // With no expiration info, default to an hour - //F64 now = LLFrameTimer::getTotalSeconds(); - //return now + DEFAULT_EXPIRES; - return DEFAULT_EXPIRES; + const F64 DEFAULT_EXPIRES = 60.0 * 60.0 + LLFrameTimer::getTotalSeconds(); + + F64 expires = 0.0; + if (expirationFromCacheControl(headers, &expires)) + { + //AO make sure cache expiration is at least 1HR + if (expires < DEFAULT_EXPIRES) {expires = DEFAULT_EXPIRES;} + return expires; + } + else + { + return DEFAULT_EXPIRES; + } } + // } bool LLAvatarNameCache::expirationFromCacheControl(const LLSD& headers, F64 *expires) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index eeaf23f300..049d3163af 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -23687,6 +23687,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSLegacyNameCacheExpiration + + Comment + Use the legacy avatar name cache expiration (expiration at least 60 mins.) + Persist + 1 + Type + Boolean + Value + 0 +