Static resources not loading when the critical update for "Serve Static Resources from the Visualforce Domain" is enabled
Last updated 2017-05-25 ·Reference W-3165458 ·Reported By 81 users
Summary
Once the "Serve Static Resources from the Visualforce Domain" critical update is applied, certain static resources return with a HTTP 404 error the very first time they are loaded with an empty cache due to a redirection taking place to an incorrect static resource URL. If the page is refreshed, they load fine.
- Actual result: HTTP 404 error is returned for certain static resources.
- Expected result: Static resources should load successfully.
Repro
1) Create two static resources
a) JQuery - this is just out-of-the-box jQuery uploaded as a static resource
b) SimpleJS - one line of Javascript below:
jQuery('#message').text('It worked! :)');
2) Create a Visualforce component as below
<apex:component access="global">
<div id="message">It did not work.</div>
<script src="{!URLFOR($Resource.JQuery)}"/>
<script src="{!URLFOR($Resource.SimpleJS)}"/>
</apex:component>
3) Create a Visualforce page as below:
<apex:page >
<loadingbug:BugTestComponent />
</apex:page>
4) Turn on the critical update "Serve Static Resources from the Visualforce Domain". This is auto-enabled and enforced in Summer '16 (it was admin controllable in Spring '16).
5) Try to access the Visualforce page directly right after logging into the org by going to https://<instance>.salesforce.com/apex/TargetApexPage.
Results:
a) Either static resource SimpleJS.js or jQuery.js will not be loaded and will return HTTP 404
b) The Visualforce page will show "It did not work.".
Workaround
a) Reload the Visualforce page.
b) In Spring '16 orgs, disable the critical update "Serve Static Resources from the Visualforce Domain".
NOTE: In Summer '16 orgs, the critical update "Serve Static Resources from the Visualforce Domain" is auto-enabled and enforced. This feature cannot be disabled.
Reported By (81)
































Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.