Universal Containersは、外部JavaScriptファイルとCSSファイルの組み込みを必要とするVisualforceページを開発しています。ページの効率的な読み込みとキャッシュを実現したいと考えています。この目標を達成するには、どの機能を活用すべきでしょうか?
正解:A
To optimize the performance of a Visualforce page that uses external assets, Static Resources (Option5 A) is the pl6atform-native best practice. Static resources allow you to upload content such as archives (.zip or .jar files), images, stylesheets, and JavaScript files that you can reference in a Visualforce page.
The primary benefits of using Static Resources over other methods (like hosting files externally or hardcoding styles) include:
* Caching: Salesforce serves static resources from a Content Delivery Network (CDN). This means once a user's browser loads the JavaScript or CSS file, it is cached locally, significantly reducing page load times for subsequent requests.
* Relative Referencing: Using the $Resource global variable (e.g., {!URLFOR($Resource.MyZipFile,
'styles/main.css')}) ensures that your page references the correct version of the file across different environments (Sandbox, Production) without changing hardcoded URLs.
* Efficiency: By bundling related files into a single ZIP archive as a static resource, you reduce the number of HTTP requests the browser must make to render the page.
Options B and D are related to AJAX and JavaScript-to-Apex communication, and Option C is a component used for rendering data tables; none of these address the storage or caching of external front-end assets.