DEV: improve comment explaining need for favicon proxy

This commit is contained in:
Sam 2019-01-02 13:15:20 +11:00
parent 9e50813252
commit 14911d50a1
1 changed files with 11 additions and 6 deletions

View File

@ -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