Skip to content

Commit

Permalink
Simplify phrasing in UDF caching for non native english speakers (#375)
Browse files Browse the repository at this point in the history
* Simplify phrasing in UDF caching for non native english speakers

* Linking out

---------

Co-authored-by: Maxime Lenormand <maximelenormand@maximes-mbp-2.home>
  • Loading branch information
MaxLenormand and Maxime Lenormand authored Feb 3, 2025
1 parent 91ff3a5 commit 66efd93
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/core-concepts/cache.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import DifferentFct from '@site/static/img/core-concepts/caching/running_differe
Fused uses a few different types of cache, but they all work in this same manner


## Caching a function inside a UDF: [`@fused.cache`](/python-sdk/top-level-functions/#fusedcache)
## Caching a function (inside a UDF): [`@fused.cache`](/python-sdk/top-level-functions/#fusedcache)

Any function inside a UDF can be cached using the [`@fused.cache`](/python-sdk/top-level-functions/#fusedcache) decorator around it:

Expand Down Expand Up @@ -215,7 +215,9 @@ gdf = local_function_load()
Read more about this in the [Python SDK page on `@fused.cache`](/python-sdk/top-level-functions/#fusedcache)
::: */}

## Caching UDFs run with a [token](/core-concepts/run-udfs/run-small-udfs/#token)
## Caching a UDF

### Calling a UDF with a [token](/core-concepts/run-udfs/run-small-udfs/#token)

While [`@fused.cache`](/python-sdk/top-level-functions/#fusedcache) allows you to cache functions _inside_ UDFs, UDFs ran with [tokens](/core-concepts/run-udfs/run-small-udfs/#token) are cached by default.

Expand All @@ -237,8 +239,13 @@ import TokenCache from '@site/static/img/core-concepts/caching/cached_token_udf.

This means that UDFs that are repeatably called with `fused.run(udf)` become much more responsive (if they have the same inputs)


### Calling a UDF from [object](/core-concepts/run-udfs/run-small-udfs/#udf-object) or [name](/core-concepts/run-udfs/run-small-udfs/#name-from-your-account)

{/*
TODO:
Add section on doing this in `fused-py` once this is implemented
*/}

🚧 Under Construction 🚧

0 comments on commit 66efd93

Please sign in to comment.