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

Related Questions

I have a page which contains the generated content. Page.aspx: <asp:DropDownList ID=cmbUsers runat=server AutoPostBack=True
I have a silverlight app that uses a simple Login.aspx page. I have all
I have a aspx page that has a UpdatePanel and a asp timer. the
I have a .aspx page that loads three separate .ascx controls to represent adding,
I have a aspx page (details page) that needs to be loaded in a
I have two aspx pages, the first that has 5 links. All 5 links
I have a asp:Content tag added to my aspx page. <asp:Content ID=Step1Content ContentPlaceHolderID=MainContent Runat=Server>
I have an aspx web page contains jquery mobile, I don't know why, whenever
I can run the Umbraco site, get to the umbraco.aspx page, but all css,
I have been trying to make jquery datepicker plugin work on a content page

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.