Skip to content

Commit b568790

Browse files
committed
typo
1 parent 848620d commit b568790

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stubbornjava-webapp/ui/src/posts/lazy-loading-and-caching-objects-in-java-with-guava-s-suppliers-memoize.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ We will be using a very simple "hello world" `Supplier` that will log every time
1818
2017-09-06 08:50:58.157 [main] INFO c.s.e.common.SuppliersExamples - hello world</code></pre>
1919

2020
## Suppliers.memoizeWithExpiration
21-
`Suppliers.memoizeWithExpiration` is also straight forward. It allows us to memoize a value from a given `Supplier` but have it update anytime we exceed the expiration time. This is a great caching mechanism for any data you know changes infrequently. A minor drawback is if the operation is expensive you may see a hiccup every time the object needs to be reloaded. Often times this is not a major concern. If it is an issue you can investigate refreshing the object asynchronously with a background thread. `Suppliers.memoizeWithExpiration` is used to cache the scraped results for our [HTML / CSS Themes](https://www.stubbornjava.com/best-selling-html-css-themes-and-website-templates) page and can be seen in the [Web scraping in Java with jsoup and OkHttp](/posts/web-scraping-in-java-using-jsoup-and-okhttp#theme-service-layer).
21+
`Suppliers.memoizeWithExpiration` is also straightforward. It allows us to memoize a value from a given `Supplier` but have it update anytime we exceed the expiration time. This is a great caching mechanism for any data you know changes infrequently. A minor drawback is if the operation is expensive you may see a hiccup every time the object needs to be reloaded. Often times this is not a major concern. If it is an issue you can investigate refreshing the object asynchronously with a background thread. `Suppliers.memoizeWithExpiration` is used to cache the scraped results for our [HTML / CSS Themes](https://www.stubbornjava.com/best-selling-html-css-themes-and-website-templates) page and can be seen in the [Web scraping in Java with jsoup and OkHttp](/posts/web-scraping-in-java-using-jsoup-and-okhttp#theme-service-layer).
2222

2323
{{> templates/src/widgets/code/code-snippet file=suppliers section=suppliers.sections.memoizeWithExpiration}}
2424
<pre class="line-numbers"><code class="language-text">2017-09-06 08:50:58.157 [main] INFO c.s.e.common.SuppliersExamples - Memoized with Expiration

0 commit comments

Comments
 (0)