Activity › Forums › Salesforce® Discussions › What are the best practices for caching in Salesforce REST?
Tagged: Application Cache, Best Practices, Caching, CSS, Dynamic Content, Javascript, Metadata API in Salesforce, REST
-
What are the best practices for caching in Salesforce REST?
Posted by Anjali on August 2, 2018 at 7:42 AMWhat are the best practices for caching in Salesforce REST?
Parul replied 7 years, 7 months ago 3 Members · 2 Replies -
2 Replies
-
best practice for caching in REST?
- Always keep static contents like images, CSS, JavaScript cacheable, with expiration date of 2 to 3 days.
- Never keep expiry date too high.
- Dynamic content should be cached for a few hours only.
- [adinserter block='9']
-
Caching is the ability to store copies of frequently accessed data in several places along the request-response path. When a consumer requests a resource representation, the request goes through a cache or a series of caches (local cache, proxy cache or reverse proxy) toward the service hosting the resource. If any of the caches along the request path has a fresh copy of the requested representation, it uses that copy to satisfy the request. If none of the caches can satisfy the request, the request travels all the way to the service (or origin server as it is formally known).
Using HTTP headers, an origin server indicates whether a response can be cached and if so, by whom, and for how long. Caches along the response path can take a copy of a response, but only if the caching metadata allows them to do so.
Optimizing the network using caching improves the overall quality-of-service in following ways:
Reduce bandwidth
Reduce latency
Reduce load on servers
Hide network failures
Log In to reply.