function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Petr Chvala 4Petr Chvala 4 

Enable Secure Static Resources for Lightning Components

If "Enable Secure Static Resources for Lightning Components" Release Update is enabled, static resources are served from visualforce.com domain. 

Everything seems fine for images, scripts, css,... 
But FONTs (ttf, woff, woff2) referenced by CSS will fail to load.

User-added image
This update should be enabled before 10-MAY-2021, but its presents seriuos issue for which we are unable to find any workaround.

Any ideas?
SwethaSwetha (Salesforce Developers) 
HI Petr,
Can you share a simplified code snippet that I can use to replicate this fonts behaviour in my Org? Thanks
Petr Chvala 4Petr Chvala 4
Hi Swetha, sure:
s000.tinyupload.com/index.php?file_id=89187794306652886045
Holds one Lightning component and static resource. Once update is enabled, cutom font will fail.
SwethaSwetha (Salesforce Developers) 
Thanks. Checking. I will update this thread as I have more information
Petr Chvala 4Petr Chvala 4

Ok, so the only way to workaround this is place @font-face rule directly to component CSS file. Once moved there, font file will be again served from lightning domain instead of visualforce.com

Sadly, that is not good thing to do, bloat component css files like this. Especially if many components are importing the same font.  99% of packages or organizations will import fonts throuh static resource css and such approach just need to work.

I hope, SFDC will fix this behavior as soon as possible, because auto-activation of this critical update is closing in.