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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:31:23+00:00 2026-05-10T22:31:23+00:00

I have an a aspx page, but all content is generated by hands(yes I

  • 0

I have an a aspx page, but all content is generated by hands(yes I know that I need to make a handler, I have another question)

I want to cache output in client browser. Problem is that it’s cached only for one query.

        public static void ProceedCaching(string etag, string lastModify, string response, HttpResponse Response,                                       HttpRequest Request)     {         Response.AddHeader('ETag', '\'' + etag + '\'');         Response.AddHeader('Last-Modified', lastModify);         Response.AppendHeader('Cache-Control', 'Public');         Response.AppendHeader('Expires',                               DateTime.Now.AddMinutes(1).ToUniversalTime().ToString('r',DateTimeFormatInfo.InvariantInfo));          string ifModified = Request.Headers['If-Modified-Since'];          if (!string.IsNullOrEmpty(ifModified))         {             if (ifModified.Contains(';'))                 ifModified = ifModified.Remove(ifModified.IndexOf(';'));         }          string incomingEtag = Request.Headers['If-None-Match'];          if (String.Compare(incomingEtag, etag) == 0 || string.Compare(ifModified, lastModify) == 0)         {             Response.StatusCode = 304;             Response.End();         }          Response.Write(response);         Response.End();     } 

it’s become preaty messy. As I said it’s cached only once. After recevieng HTTP 304 browser will send clean request without caching information(etag, lastmodified). Have any ideas?

  • 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. 2026-05-10T22:31:24+00:00Added an answer on May 10, 2026 at 10:31 pm

    Found this answer here

    Generally speaking, these are the most common rules that are followed (don’t worry if you don’t understand the details, it will be explained below):

    1. If the response’s headers tell the cache not to keep it, it won’t.
    2. If the request is authenticated or secure, it won’t be cached.
    3. If no validator (an ETag or Last-Modified header) is present on a response, and it doesn’t have any explicit freshness information, it will be considered uncacheable.
    4. A cached representation is considered fresh (that is, able to be sent to a client without checking with the origin server) if:
      • It has an expiry time or other age-controlling header set, and is still within the fresh period.
      • If a browser cache has already seen the representation, and has been set to check once a session.
      • If a proxy cache has seen the representation recently, and it was modified relatively long ago. Fresh representations are served directly from the cache, without checking with the origin server.
    5. If an representation is stale, the origin server will be asked to validate it, or tell the cache whether the copy that it has is still good.

    And Microsoft has a good article if you don’t want it to cache.

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

Sidebar

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer This is not related to exceptions but rather to undefined… May 11, 2026 at 10:01 am
  • added an answer You'll have to do this in JavaScript during the onLoad… May 11, 2026 at 10:01 am
  • added an answer There's a mailing list at http://www.exim.org/maillist.html. The problem you will… May 11, 2026 at 10:01 am

Related Questions

I have an a aspx page, but all content is generated by hands(yes I
I have an ASPX page (On server A) which is invoked using NTLM credentials.
I have an aspx page with a gridview. In my page load event, I
I have an aspx page that uses a master page. On this page I
I have an aspx page,where the user will enter a valid image url(ex :
I have an aspx page where i am Processing a large number of records
I have an ASPX page that is dynamically creating a gridview from a database
I have an ASPX page and on this page I have a control that
I have a panel on an aspx page which contains an UpdatePanel. This panel
I have a treeview control on an aspx page. The data comes from database

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.