Skip to content

Commit d33d3e3

Browse files
committed
Fix table name
1 parent f0e04bd commit d33d3e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/developers/applications/caching.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class ThirdPartyAPI extends Resource {
3636
Next, we define this external data resource as the "source" for the caching table we defined above:
3737

3838
```javascript
39-
const { MyTable } = tables;
40-
MyTable.sourcedFrom(ThirdPartyAPI);
39+
const { MyCache } = tables;
40+
MyCache.sourcedFrom(ThirdPartyAPI);
4141
```
4242

4343
Now we have a fully configured and connected caching table. If you access data from `MyCache` (for example, through the REST API, like `/MyCache/some-id`), Harper will check to see if the requested entry is in the table and return it if it is available (and hasn't expired). If there is no entry, or it has expired (it is older than one hour in this case), it will go to the source, calling the `get()` method, which will then retrieve the requested entry. Once the entry is retrieved, it will be saved/cached in the caching table (for one hour based on our expiration time).

0 commit comments

Comments
 (0)