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 6365467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:17:48+00:00 2026-05-25T00:17:48+00:00

We have a situation where we are calling a function on a API that

  • 0

We have a situation where we are calling a function on a API that is rather expensive. Lets call it API.ExpensiveCall()

This ExpensiveCall() is called frequently within a web application. Although it is not noticeable with one user, it becomes noticeable when you have 5 or so simultaneous users.

We want to cache these results. But since API.ExpensiveCall() is essentially a black box to us, we have no way of invalidating our cache, to know when to refresh.

So our proposed solution was to create a windows service, which would simply call this API.ExpensiveCall() every ten seconds, then save the results into a local database that the web application is already using.

This way it would not matter if there is 1 user or 20+ users on the website, the ExpensiveCall() is only called every 10 seconds. It is a very controlled load on the external system the API.ExpensiveCall() is connected to.

The problem

Our Project manager does not agree with this. For some reason he thinks a timed refresh every 10 seconds is a bad idea, because in his opinion puts too much load on the external system.

But if we don’t do anything about it, and leave things the way they are without any sort of caching, it not only degrades the performance of the web application, but it will definitely cause way more than one ExpensiveCall per second on the external system. And that number would multiply depending on the number of users on the web application.

I would like to ask you is this way of caching really such a bad idea? Have you heard of other systems using such a method for caching? And if it is such a bad idea, are there any alternative better ways of caching results from system when it is a black box to you?

EDIT:

Your responses seem to indicate that I should be using the timeout feature of ASP.Net’s memory caching mechanism.

I like the timeout idea. The only (small) issue I see with it now is that when the timeout expires and it is time to call the ExpensiveCall(), it will be a blocking call. As opposed to querying a local table, which is kept up to date by constantly refreshing in a separate process. This is the thing I find attractive with the polling idea. Although I must admit it does feel weird to be polling every 10 seconds, which is why I’m on the fence about it.

  • 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-25T00:17:49+00:00Added an answer on May 25, 2026 at 12:17 am

    Take a look at my response to this question – it describes a way to ensure fresh data in a standard cache. Seems like it might directly address your situation as well.

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

Sidebar

Related Questions

Lets say that I have a function todo() and I want to implement this
see i have one library which has two api lets call api1() and api2()
I am in a situation where I have a loop that is calling a
i have situation like this: class IData { virtual void get() = 0; virtual
I have situation, where running a query that filters by an indexed column in
I have situation like this: user submits form with action='/pay' in '/pay' I have
I'm finding plenty of examples through Google of how to call an API function
I have this weird situation. I have these two classes: Public Class Entry End
Just wondering whether an object can self-destruct. Consider this situation. An object that extends
Just wondering whether an object can self-destruct. Consider this situation. An object that extends

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.