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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:09:15+00:00 2026-05-13T15:09:15+00:00

We are writing a portal and like every portal we store html data in

  • 0

We are writing a portal and like every portal we store html data in Db fro Modules.
So I thought that I can cache each module in files. I use OnLoad event to check if there is a cache file for this Module, use that and else create cache file:

if (!IsPostBack)
  {
   string Path = AppDomain.CurrentDomain.BaseDirectory + "\\Cache\\Modules\\" + ModuleId + ".dat";
   if (File.Exists(Path))
   {
    Controls.Clear();
    Literal ltCache = new Literal();
    ltCache.Text = File.ReadAllText(Path);
    Controls.Add(ltCache);
   }
   else
   {
    base.OnLoad(e);
    StringBuilder SB = new StringBuilder();
    StringWriter SW = new StringWriter(SB);
    HtmlTextWriter htmlTW = new HtmlTextWriter(SW);
    //this.Visible = true;
    this.RenderControl(htmlTW);
    File.WriteAllText(Path, SB.ToString());
    //this.Visible = false;
   }
  }

but know I doubt that it’s a good idea.
what do you think? retrieving data from file can slow server more than retrieving data from DB?

  • 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-13T15:09:15+00:00Added an answer on May 13, 2026 at 3:09 pm

    Since you are using the .NET Framework, you should probably use one of the many .NET caching features.

    You may want to check the following articles for some tips on the topic:

    • ASP.NET Caching Features
    • MSDN: ASP.NET Caching: Techniques and Best Practices
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Writing documentation in html requires some code examples. What to do with characters that
I'm writing a portal in PHP that allows users to upload DICOM images, and
Writing a function I must declare input and output data types like this: int
I am writing a JSR-168 portlet that can be added to a container multiple
Writing a client application that sends images to a server via a webservice. As
I writing a JSP program that needs to react on an existing program. It
I'm writing an application to show some news from a portal. The news are
I am writing data from a DataView in a ASP.NET app to an Excel
I'm writing a piece of JS code that returns a result of true if
I am writing web portal for mobile phones using .net framework, I have tested

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.