diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 3c141aa37aa16eb0bfe5a6b17f6499e2caf95dfb..84a494186fe91b277cdd74bea576a98c777298b3 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2871,7 +2871,8 @@ class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder
 public:
 	RequestAgentUpdateAppearanceResponder()
 	{
-		mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10);
+		bool retry_on_4xx = true;
+		mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10, retry_on_4xx);
 	}
 
 	virtual ~RequestAgentUpdateAppearanceResponder()
diff --git a/indra/newview/llhttpretrypolicy.cpp b/indra/newview/llhttpretrypolicy.cpp
index 80d97e4362f3f2424d54305b30db1e816ab17eb6..1512b46103208ce436fe2effbbe35c10c1044128 100755
--- a/indra/newview/llhttpretrypolicy.cpp
+++ b/indra/newview/llhttpretrypolicy.cpp
@@ -28,11 +28,12 @@
 
 #include "llhttpretrypolicy.h"
 
-LLAdaptiveRetryPolicy::LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries):
+LLAdaptiveRetryPolicy::LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries, bool retry_on_4xx):
 	mMinDelay(min_delay),
 	mMaxDelay(max_delay),
 	mBackoffFactor(backoff_factor),
-	mMaxRetries(max_retries)
+	mMaxRetries(max_retries),
+	mRetryOn4xx(retry_on_4xx)
 {
 	init();
 }
@@ -108,7 +109,7 @@ void LLAdaptiveRetryPolicy::onFailureCommon(S32 status, bool has_retry_header_ti
 		llinfos << "Too many retries " << mRetryCount << ", will not retry" << llendl;
 		mShouldRetry = false;
 	}
-	if (!isHttpServerErrorStatus(status))
+	if (!mRetryOn4xx && !isHttpServerErrorStatus(status))
 	{
 		llinfos << "Non-server error " << status << ", will not retry" << llendl;
 		mShouldRetry = false;
diff --git a/indra/newview/llhttpretrypolicy.h b/indra/newview/llhttpretrypolicy.h
index 1fb0cac03f5ed453132a3a1b2efcc47ed22fe9f8..5b1a1d79e037a342decadde0f3e264a2467d86b6 100755
--- a/indra/newview/llhttpretrypolicy.h
+++ b/indra/newview/llhttpretrypolicy.h
@@ -60,7 +60,7 @@ class LLHTTPRetryPolicy: public LLThreadSafeRefCount
 class LLAdaptiveRetryPolicy: public LLHTTPRetryPolicy
 {
 public:
-	LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries);
+	LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries, bool retry_on_4xx = false);
 
 	// virtual
 	void onSuccess();
@@ -88,6 +88,7 @@ class LLAdaptiveRetryPolicy: public LLHTTPRetryPolicy
 	U32 mRetryCount; // number of times shouldRetry has been called.
 	LLTimer mRetryTimer; // time until next retry.
 	bool mShouldRetry; // Becomes false after too many retries, or the wrong sort of status received, etc.
+	bool mRetryOn4xx; // Normally only retry on 5xx server errors.
 };
 
 #endif
diff --git a/indra/newview/tests/llhttpretrypolicy_test.cpp b/indra/newview/tests/llhttpretrypolicy_test.cpp
index ed7f3ba326875bd4895b2f73687f3f3f6c266344..25e6de46d9572b19246f599db643b5363a37d8ff 100755
--- a/indra/newview/tests/llhttpretrypolicy_test.cpp
+++ b/indra/newview/tests/llhttpretrypolicy_test.cpp
@@ -56,12 +56,19 @@ void RetryPolicyTestObject::test<1>()
 template<> template<>
 void RetryPolicyTestObject::test<2>()
 {
-	LLAdaptiveRetryPolicy retry404(1.0,2.0,3.0,10);
 	LLSD headers;
 	F32 wait_seconds;
-	
-	retry404.onFailure(404,headers);
-	ensure("no retry on 404", !retry404.shouldRetry(wait_seconds)); 
+
+	// Normally only retry on server error (5xx)
+	LLAdaptiveRetryPolicy noRetry404(1.0,2.0,3.0,10);
+	noRetry404.onFailure(404,headers);
+	ensure("no retry on 404", !noRetry404.shouldRetry(wait_seconds)); 
+
+	// Can retry on 4xx errors if enabled by flag.
+	bool do_retry_4xx = true;
+	LLAdaptiveRetryPolicy doRetry404(1.0,2.0,3.0,10,do_retry_4xx);
+	doRetry404.onFailure(404,headers);
+	ensure("do retry on 404", doRetry404.shouldRetry(wait_seconds)); 
 }
 
 template<> template<>