Creating a Static Resource
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.
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.
- 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.
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.