---
schema_version: "1"
id: 1524d86ebefb530e07b4e04a9214c040cfe7b6bca742f0b57b244a2457e5db96
title: Best Practices for Static Resources
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/best-practices/pages-compref-additional-page.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-compref-additional-page.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2c94a3a060dfeabfff3f512d05ae9c78982016cbee114878567f0773f9f82198
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# Best Practices for Static Resources

## Displaying the Content of a Static Resource with the `action` Attribute on `<apex:page>`

You can use the `action` attribute on a `<apex:page>` component to redirect from a Visualforce page to a static resource. This functionality allows you to add rich, custom help to your Visualforce pages. For example, to redirect a user to a PDF:

1.  Upload the PDF as a static resource named `customhelp`.
2.  Create the following page:

    <!-- otherprops: resourcename=customhelp apex_page set_clipboard -->
    ```markup
    <apex:page sidebar="false" showHeader="false" standardStylesheets="false" 
          action="{!URLFOR($Resource.customhelp)}">
    </apex:page>
    ```


Notice that the static resource reference is wrapped in a `URLFOR` function. Without that, the page does not redirect properly.

This redirect is not limited to PDF files. You can also redirect a page to the content of any static resource. For example, you can create a static resource that includes an entire help system composed of many HTML files mixed with JavaScript, images, and other multimedia files. As long as there is a single entry point, the redirect works. For example:

1.  Create a zip file that includes your help content.
2.  Upload the zip file as a static resource named `customhelpsystem`.
3.  Create the following page:

    <!-- otherprops: resourcename=customhelpsystem apex_page set_clipboard -->
    ```markup
    <apex:page sidebar="false" showHeader="false" standardStylesheets="false" 
          action="{!URLFOR($Resource.customhelpsystem, 'index.htm')}">
    </apex:page>
    ```


When a user visits the page, the index.htm file in the static resource displays.

**See Also**  


-   [Using Static Resources](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/resources/pages-resources.md)

