Skip to content

A platform for community discussion. Free, open, simple.

DEV: improve comment explaining need for favicon proxy

Sam14911d50a18e
diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb
index bd6b2e5dde4..7037e1f257a 100644
--- a/app/controllers/static_controller.rb
+++ b/app/controllers/static_controller.rb
@@ -103,12 +103,17 @@ class StaticController < ApplicationController
FAVICON ||= -"favicon"
- # We need to be able to draw our favicon on a canvas
- # and pull it off the canvas into a data uri
- # This can work by ensuring people set all the right CORS
- # settings in the CDN asset, BUT its annoying and error prone
- # instead we cache the favicon in redis and serve it out real quick with
- # a huge expiry, we also cache these assets in nginx so it bypassed if needed
+ # We need to be able to draw our favicon on a canvas, this happens when you enable the feature
+ # that draws the notification count on top of favicon (per user default off)
+ #
+ # With s3 the original upload is going to be stored at s3, we don't have a local copy of the favicon.
+ # To allow canvas to work with s3 we are going to need to add special CORS headers and use
+ # a special crossorigin hint on the original, this is not easily workable.
+ #
+ # Forcing all consumers to set magic CORS headers on a CDN is also not workable for us.
+ #
+ # So we cache the favicon in redis and serve it out real quick with
+ # a huge expiry, we also cache these assets in nginx so it is bypassed if needed
def favicon
is_asset_path