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

  • SEARCH
  • Home
  • 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 6189483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:25:20+00:00 2026-05-24T02:25:20+00:00

I have two situations in this case: I want to query a WCF service

  • 0

I have two situations in this case:

I want to query a WCF service and hold the data somewhere, because one of the web pages renders based on the data that’s retrieved from the service. I don’t want the page itself querying the service, but I’d rather have some sort of scheduled worker that runs once every a couple of minutes, and retrieves the data and holds it somewhere.

Where should I cache the service response, and what is the correct way to create the task to query the service every couple minutes?

I think I could achieve this by saving the response to a static variable, alongside the last query date, and then check on the page load if enough time has passed, I call the service and refresh the data, else I use the static cache.

This would also account for the case where no users access the page for a long time, and the site not futilely querying the service.

But it seems kind of rough, are there other, better ways to accomplish this kind of task?

  • 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-24T02:25:20+00:00Added an answer on May 24, 2026 at 2:25 am

    You could indeed take another approach like having a scheduled program query the information and put it in an in-memory cache available to all the web servers in your farm. However, whether that would be better for your scenario depends on the size of your app and how much time/effort you want to spend on it.

    An in-memory cache is harder to implement/support than a static variable but it’s sometimes better since static variables can be cleared up every time the server resets (e.g. after X number of minutes of inactivity)

    Depending on the size of your system I would start with the static variable, test drive the approach for a while and then decide if you need something more sophisticated.

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

Sidebar

Related Questions

This is my situation. I have two activities: ONE and TWO. In TWO activity
I have a one-to-many relationship between two classes for this situation. I have a
I have two Methods in a WCF Service say Method1() { _currentValue = 10;
In this situation I have two models, Comment and Score. The relationship is defined
this is my situation: I have two org.w3c.dom.Document created from two xml files. What
I have these two situations: String s = aa; s = s + aa;
My situation is I have two tables. I want to join them together and
Consider the following situation: We have two Localizable.string files, one in en.lproj and one
I have two entities, Job and Language , in a many-to-one relationship. The mapping
Let's say we have two functions: int f(); int g(); I want to get

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.