PERF: Defer setting of distributed cache in category.

PERF: Defer setting of distributed cache in category.

See follow up commit for rational.

Follow-up to 8cfe203

diff --git a/app/models/category.rb b/app/models/category.rb
index e2c6edc..6692d2d 100644
--- a/app/models/category.rb
+++ b/app/models/category.rb
@@ -735,7 +735,9 @@ class Category < ActiveRecord::Base
   end
 
   def url
-    @@url_cache[self.id] ||= "#{Discourse.base_path}/c/#{slug_path.join('/')}/#{self.id}"
+    @@url_cache.defer_get_set(self.id) do
+      "#{Discourse.base_path}/c/#{slug_path.join('/')}/#{self.id}"
+    end
   end
 
   def url_with_id

GitHub sha: 982eaab9

This commit appears in #13279 which was approved by lis2. It was merged by tgxworld.