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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:10:48+00:00 2026-05-15T10:10:48+00:00

I am wondering about potential issues with – alternatives to – caching using an

  • 0

I am wondering about potential issues with – alternatives to – caching using an application variable. To preface, I have a custom application object that stores all application data in ONE application variable – the object organizes data in an XML cloud and stores the cloud in one variable for performance.

I am aware of DataSet caching, but all of my DAL objects select (read only) into data readers for performance, so if the solution involves DataSets I have a ton of refactoring to do – not ideal. Record count is low to medium, involving website data and small to medium project management apps; we’re not talking a half-million records.

Here is the structure of the function I intend to use in my DAL classes (Select All):

if (AppSetting.GetSetting(_CacheSettingName) == "")
    {
        SqlHelper objSqlHelper = new SqlHelper();
        XmlReader objReader = objSqlHelper.GetXmlReaderByCmd("Select * From FAQ FOR XML PATH('item'), root('" + _CacheSettingName + "')");

//load Cache       

        StringBuilder _xml = new StringBuilder();
        objReader.Read();
        while (objReader.ReadState != ReadState.EndOfFile)
        {
            _xml.Append(objReader.ReadOuterXml());
        }
        objSqlHelper.Dispose();
        AppSetting.SaveSetting(_CacheSettingName, _xml.ToString());
    }
    //we have cache loaded
    // now load the object list from the XML cloud from the application cache       
    List<FAQBLL> objFAQList = new List<FAQBLL>();
    FAQBLL objFAQ;
    XmlDocument oXmlDocument = new XmlDocument();
    oXmlDocument.LoadXml(AppSetting.GetSetting(_CacheSettingName));
    foreach (XmlNode oNode in oXmlDocument.FirstChild.ChildNodes)
    {
        objFAQ = new FAQBLL();
        objFAQ.ID = Convert.ToInt32(oNode.SelectSingleNode("ID").InnerXml);
        objFAQ.Question = oNode.SelectSingleNode("Question").InnerXml;
        objFAQ.Answer = oNode.SelectSingleNode("Answer").InnerXml;
        objFAQList.Add(objFAQ);
        objFAQ = null;

    }

    return objFAQList.Count > 0 ? objFAQList: null;

So my cache returns all to the calling proc, then I LINK to filter the object (by active, by location). On insert, update, and delete I have one line of code to clear the cache. Again, I have the advantage of using read only data readers for performance, and my application object organizes XML into one application variable. MY thinking was that this is low overhead, not having to discard data readers for data sets when I’m just reading data.

Thoughts? Opinions? Are you traumatized by this?

  • 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-15T10:10:49+00:00Added an answer on May 15, 2026 at 10:10 am

    yes, it is a little traumatizing. The problem with using application variables as a cache is that you forfeit some of the best features of caches. For example, the asp.net cache provides some awesome cache invalidation features. This ensures that a) the cache does not increasingly take up more and more resources, and b) that the cache remains fresh (for example, if sourced from a database).

    You should really think about using the right tool for the job

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

Sidebar

Related Questions

I have had a customer contact me about a bug in my application which
Wondering if there is a way to change the object on the heap that
Whilst implementing my first MVVM application in WPF, I've been wondering about the pros
I have been wondering about the performance of regular expression implementations lately, and have
I've been wondering about JavaScript's prototypal nature, and the benefits of it, and have
I'm wondering about a best practice using NHibernate, AutoMapper and ASP.NET MVC. Currently, i'm
I'm wondering about instances when it makes sent to use #define and #if statements.
I'm wondering about MP3 decoding/encoding, and I was hoping to pull this off in
I've been wondering about the performance improvements touted in Java SE 6 - is
I'm wondering about the practical use of #undef in C. I'm working through K&R,

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.