Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7702283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:11:33+00:00 2026-05-31T23:11:33+00:00

Does play automatically cache data? I’m trying to read this code that someone else

  • 0

Does play automatically cache data?
I’m trying to read this code that someone else wrote and he does Cache.get while inside a foreach loop. This is also where the program stalls.

This person did not use Cache.set anywhere else related to this method so I don’t understand what is happening.

An example of the code:

for(aList page: pages){
    //blah blah code;

    Page.PageInfo pageinfo = (Page.PageInfo) Cache.get(page.url);

    //blah blah code;
}

However he does use Cache.set after this foreach loop in another foreach loop but I don’t understand how he is getting something if there is nothing set in there.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:11:34+00:00Added an answer on May 31, 2026 at 11:11 pm

    Play has its own Cache API which can be backed by the default EHCache implementation or something more advanced like Memcached.

    Cache is only a cache, so it is not guaranteed that Cache.get() calls will always provide results. The code snippet you provided is obviously lacking a null check after the Cache.get() call to see whether result was found or not. If Cache doesn’t have the value, you’re supposed to get it from elsewhere (database, usually, which is more costly operation but guaranteed to return the result) or continue working without the value, if it is not critical.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In someone else's code I read the following two lines: x = defaultdict(lambda: 0)
We recently discovered that the Google Maps API does not play nicely with SSL.
Does anybody know of a plug-and-play login system that supports existing logins like Google
On this site , the video doesn't play in FF. But it does play
I would like to include audio that will automatically play when the user scrolls
I am trying to play an online MP4 http://www.elecard.biz/clips/mp4/misc/River.mp4 With WMP 12 that ships
I am trying to write a script so that when I play an embedded
Does play framework server have a rewrite_mode functionality like apache? That is: how can
I'm currently working on an app that allows the user to play (automatically scroll)
NuGet package restore does not play well with the PostSharp package, this is of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.