Skip to content

Commit b2aa1fb

Browse files
committed
Update examples with the renamed key
1 parent e755435 commit b2aa1fb

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,15 @@ Essentially this is a convenience for setting
360360
The Umbraco convention with other Cache Helpers, eg Html.CachedPartial is to clear all memory caches whenever any item is published in the Umbraco Backoffice. By default the our-cache tag helper will do the same, however you can turn this part off on an individual TagHelper basis by setting update-cache-key-on-publish="false".
361361

362362
'''cshtml
363-
<our-cache update-cache-key-on-publish="false">[Your Long Running Expensive Code Here]</our-cache>
363+
<our-cache>[Your Long Running Expensive Code Here]</our-cache>
364+
'''
365+
is the same as:
366+
'''cshtml
367+
<our-cache update-cache-on-publish="true">[Your Long Running Expensive Code Here]</our-cache>
368+
'''
369+
But to turn it off:
370+
'''cshtml
371+
<our-cache update-cache-on-publish="false">[Your Long Running Expensive Code Here]</our-cache>
364372
'''
365373

366374
(NB if you had a thousand tag helpers on your site, all caching large amounts of content, and new publishes to the site occurring every second - this might be detrimental to performance, so do think of the context of your site before allowing the cache to be cleared on each publish)
@@ -378,14 +386,14 @@ All examples will skip the cache for Umbraco preview mode and debug mode, and ev
378386
</our-cache>
379387
380388
<our-cache>
381-
<!-- A global naviagtion needs to be updated across entire site when phone number changes on homepage node -->
389+
<!-- A global navigation needs to be updated across entire site when phone number changes on homepage node -->
382390
<partial name="Navigation" />
383391
</our-cache>
384392
385393
```
386394
This example will turn off the automatic clearing of the tag helper cache if 'any page' is published, but still clear the cache if the individual page is published:
387395
```cshtml
388-
<our-cache update-cache-key-on-publish="false" vary-by="@Model.UpdateDate.ToString()">
396+
<our-cache update-cache-on-publish="false" vary-by="@Model.UpdateDate.ToString()">
389397
<p>@DateTime.Now - A set Date in time</p>
390398
</our-cache>
391399
```

0 commit comments

Comments
 (0)