Loading

Static resources occasionally redirect to the login page

게시 일자: Oct 13, 2022
상세 설명

If you navigate to a public static resource's detail page, click View File, take the URL from the browser's address bar, and use this URL in an Community - Guest users will intermittently get redirected to the login page.
솔루션
The View File link in a static resource's detail page may look similar to these:
  • Org without namespace, My Domain not enabled: https://c.<instance>.visual.force.com/resource/<timestamp>/<static_resource_name>
  • Org without namespace, My Domain enabled: https://<my-domain>--c.<instance>.visual.force.com/resource/<timestamp>/<static_resource_name>
  • Org with namespace, My Domain not enabled: https://<namespace>.<instance>.visual.force.com/resource/<timestamp>/<namespace>__<static_resource_name>
  • Org with namespace, My Domain enabled: https://<my-domain>--<namespace>.<instance>.visual.force.com/resource/<timestamp>/<namespace>__<static_resource_name>
This URL is available to users that log into Salesforce via a standard login page (e.g. login.salesforce.com page), but it is not meant to be used directly (copied and used elsewhere "as is") despite its Cache Control setting being "Public". Instead usage should be as per the Static Resources help document. 

If, for instance, this URL is used in a community page that can be accessed by guest users, on trying to opening the URL guest users will intermittently get redirected to the login page. This is due to the fact that the server cache tier may not have this resource in its cache, in which case it will be fetched from the app server tier, that will only serve requests coming from visual.force.com if they are authenticated, and send a redirection to login otherwise (e.g. if they come from a guest user). 
Knowledge 기사 번호

000383810

 
로드 중
Salesforce Help | Article