Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb568790

Browse files
committed
typo
1 parent848620d commitb568790

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 alsostraight 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 alsostraightforward. 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-snippetfile=supplierssection=suppliers.sections.memoizeWithExpiration}}
2424
<preclass="line-numbers"><codeclass="language-text">2017-09-06 08:50:58.157 [main] INFO c.s.e.common.SuppliersExamples - Memoized with Expiration

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp