You are here:
Define Static Resources
You can use static resources to upload content that you can reference in a Visualforce page, including archives (such as .zip and .jar files), images, style sheets, JavaScript, and other files. You can use static resources only within your org, so you can’t host content here for other apps or websites.
Required Editions
| Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience |
| Available in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions |
| User Permissions Needed | |
|---|---|
| To create static resources: | Customize Application |
- From Setup, in the Quick Find box, enter Static Resources, and then select Static Resources.
- To create a static resource, click New.
-
Enter a name that identifies the resource in Visualforce
markup.
This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
Note If you reference a static resource in Visualforce markup and then change the name of the resource, the Visualforce markup is updated to reflect that change. - If needed, specify a description for the static resource.
-
To upload a static resource, click Browse
and then select a local file.
A single static resource can be up to 5 MB, and an org can have up to 250 MB of static resources, total.
-
Set the cache control for user sessions, including API and Experience Cloud user
sessions.
If set to private, the static resource is accessible to all authenticated users. The static resource is stored on the Salesforce server in a user’s individual cache for the duration of the session.
Note If a Salesforce Site has guest user profile restrictions based on IP range or login hours, the cache control for static resources is set to private. A Salesforce Site with guest user profile restrictions caches static resources only within the browser. If a previously unrestricted Salesforce Site becomes restricted, it can take up to 45 days for the static resources to expire from the Salesforce cache and any intermediate caches.If set to public, the static resource is accessible to all internet traffic, including unauthenticated users, after it’s cached. The resource is stored on the Salesforce server in a shared cache, which results in faster load times.
For technical information about cache control, see the W3C specifications for HTTP Semantics. - Save your changes.

