is an option for CloudObject and related cloud functions that specifies the time duration for which a response is cached by a client or on the server.


  • CachePersistence->t specifies that cached values should be kept for t seconds.
  • CachePersistence supports Quantity objects.
  • Possible settings for CachePersistence include:
  • Automaticcache static objects such as HTML pages or images for a short amount of time, while not caching other objects
    Nonedo not cache the object
    tcache the object for t seconds
    Quantity[]cache the object for the specified quantity of time
  • The cloud server adds a Cache-Control header to the HTTP response based on CachePersistence, which is taken into account by web browsers to cache the response.
  • CachePersistence can be used with Delayed to specify how long to keep server-side cached versions of computations.


open allclose all

Basic Examples  (3)

Export an image to cloud that will be cached in the browser for 1 day:

Check the value of the "cache-control" response header to verify the time duration for which the object will be cached by a web browser:

Deploy an expression that always evaluates on request:

Deploy an expression that is cached for up to 10 seconds:

Request the expression continuously for several seconds to confirm that the expression is only updated approximately every 10 seconds:

Scope  (1)

Deploy a delayed evaluation with a server-side cache of 5 seconds, then redeploy it with no server-side cache. The redeployment invalidates the previous server-side cache:

Wolfram Research (2015), CachePersistence, Wolfram Language function,


Wolfram Research (2015), CachePersistence, Wolfram Language function,


Wolfram Language. 2015. "CachePersistence." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2015). CachePersistence. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2021_cachepersistence, author="Wolfram Research", title="{CachePersistence}", year="2015", howpublished="\url{}", note=[Accessed: 21-January-2022 ]}


@online{reference.wolfram_2021_cachepersistence, organization={Wolfram Research}, title={CachePersistence}, year={2015}, url={}, note=[Accessed: 21-January-2022 ]}