
Right-click on the root directory of your project, and navigate down to the Force.com Menu > Add/Remove Metadata Components. Choose either the entire Static Resources directory or navigate to the specific one you want. Alternatively, you can edit the package.xml directly and make sure you have this line of code:
Full Answer
What are static resources in Salesforce?
Using Static Resources | Visualforce Developer Guide | Salesforce Developers Static resources allow you 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.
How do I create a new Static resource?
From Setup, enter Static Resources in the Quick Find box, then select Static Resources to display the Static Resources list page, which shows the list of resources defined for your organization. From this page you can: Click New Static Resource to define a new static resource.
How are static resources stored in the cache?
The static resource is stored in cache only for the current user’s session. Note Cache settings on static resources are set to private when accessed via a Salesforce Site whose guest user's profile has restrictions based on IP range or login hours. Sites with guest user profile restrictions cache static resources only within the browser.
Is there a way to cache lastmodifieddate in staticresource?
You can also query the StaticResource and use the actual LastModifiedDate timestamp in the URL and that will also give you caching too at the cost of a bit more complexity. Per Phil's comment below, I'd missed the point about the markup being static HTML.

Can we deploy static resource in Salesforce?
Create and upload JavaScript files to Salesforce as static resources and then apply them to your website or Experience Builder site. With static resources, you can change one or many pages with a few clicks in code settings on existing deployments.
Can we deploy static resources?
You can set up an 'unzippedStaticResources' directory within your project where you store the unzipped version of your static resource. When you do an ant deploy, an ant task automatically zips up the contents and copies it to the staticresource directory before the deployment happens.
How do I update a static resource in Salesforce?
Click New Static Resource to define a new static resource. Click a resource name to display detailed information about the page, including its MIME type and size. Click Edit next to a resource to modify the resource's name or to upload a new version of the resource. Click Del to remove a resource.
How do I restore a static resource in Salesforce?
Right-click on the direct link to download the file, rather than opening it in a browser window.From Setup, enter Static Resources in the Quick Find box, then select Static Resources, and then click New.Enter jQuery for the Name.Click Choose File, and then choose the jQuery JavaScript file you downloaded previously.More items...
What is deploy static?
Overview of static view files deployment “Static” means it can be cached for a site (that is, the file is not dynamically generated). Examples include images and CSS generated from LESS. “View” refers to presentation layer (from MVC).
How do I upload a file to a static resource in salesforce?
Upload the ZIP file to your org's static resources.From Setup, enter Static Resources in the Quick Find box, and then select Static Resources.Click New, complete the following fields for the static resource, and save. Field. Value. Name. Enter a meaningful name for the static resource. File.
What is the use of static resource in Salesforce?
Static resources allow you 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. Static resources can be used only within your Salesforce org, so you can't host content here for other apps or websites.
How do I edit a static source?
Required Editions and User Permissions From Setup, enter Static Resources in the Quick Find box, then select Static Resources. To view the resource details, click the name of a resource. Available details include the MIME type, the size of the resource in bytes, when it was created, and when it was last modified.
How do you query a static resource?
If you want to get some file from zipped static resource, you can use getContent(): StaticResource static_resource = [SELECT Id, SystemModStamp FROM StaticResource WHERE Name = 'My Zip Array' LIMIT 1]; String url_file_ref = '/resource/' + String. valueOf(((DateTime)static_resource.
How do I retrieve static resources in VS code?
Go to Setup -> Develop -> Static Resources -> click New -> Provide dummy name (testRecource), file, select public -> Save. Go back to VS code project - in file tree find folder 'staticresources' -> right click -> select SFDX: Retrieve Source from Org -> wait until is successfully completed.
How do you access static resources in lightning component?
To obtain a reference to a static resource in JavaScript code, use $A. get('$Resource. resourceName ') .
How can we retrieve static resource using package XML?
2 AnswersUpload desired static resource to organization by means of Develop -> Static resources -> New with name, for example TestResource.Add static resource to package.xml.
File Suffix and Directory Location
The file suffix is .resource for the template file. The accompanying metadata file is named resource-meta.xml.
Wildcard Support in the Manifest File
This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.
