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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:51:05+00:00 2026-05-26T22:51:05+00:00

I added an outputcache directive to my asp.net page (asp.net 4.0) as such: <%@

  • 0

I added an outputcache directive to my asp.net page (asp.net 4.0) as such:

        <%@ OutputCache Duration="3600" Location="Client" VaryByParam="None" %>

However, this does not appear to be working. When I check the http header information I see this:

        HTTP/1.1 200 OK => 
        Cache-Control => no-cache, no-store
        Pragma => no-cache
        Content-Type => text/html; charset=utf-8
        Expires => -1
        Server => Microsoft-IIS/7.0
        X-AspNet-Version => 4.0.30319
        Set-Cookie => ASP.NET_SessionId=0txhgxrykz5atrc3a42lurn1; path=/; HttpOnly
        X-Powered-By => ASP.NET
        Date => Tue, 15 Nov 2011 20:47:28 GMT
        Connection => close
        Content-Length => 17428

The above shows that the OutputCache directive was not applied. I even tried this from codebehind:

        this.Response.Cache.SetExpires(DateTime.Now.AddHours(1.0));
        TimeSpan ds = new TimeSpan(0, 1, 0, 0);
        this.Response.Cache.SetMaxAge(ds);

The above code should have the same results as the OutputCache directive, but when I check the http header information, I can see it’s still not being applied.

Basically, the purpose here is to make sure that when a user clicks the back button and lands on my page, the page will not be retrieved from the server. I want to avoid getting the browser popup that asks the user to ‘resend.’ I want the browser to just use the copy of the page it has in it’s cache.

Thanks in advace for any help.

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

    From your question:

    I want to avoid getting the browser popup that asks the user to
    ‘resend.’ I want the browser to just use the copy of the page it has
    in it’s cache.

    If browser asks you to resend data, it means that content was response to POST request.

    According to RFC 2616 – Hypertext Transfer Protocol — HTTP/1.1:

    Some HTTP methods MUST cause a cache to invalidate an entity. This is
    either the entity referred to by the Request-URI, or by the Location
    or Content-Location headers (if present). These methods are:

    • PUT
    • DELETE
    • POST

    So, to make cache work, you need to convert your POST to GET.

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

Sidebar

Related Questions

I have an actionResult that I've added caching to. [OutputCache(Duration = 120)] When I
I added the ModalPopupExtender to an existing ASP.NET application. At runtime I get the
I added a configuration variable in application.rb such as module Www class Application <
I added this part of the code in my onCreate() method and it crashes
I added a user control in my MyDashboards.aspx page; <uc:dlUC ID=dashboardListUserControl runat=server OnInit=ConfigureDashboardList />
Added this code NSDateFormatter *df = [[NSDateFormatter alloc]init]; NSString *entry = @March 28, 2012;
I have an ASP.NET MVC 3 application with a SQL Server 2005 database backend.
I added this code to the head but when I try to post something
I added swipeleft and swiperight listeners this way $(#slides li).swipeleft(function(){ console.log(!!!! swipe left); });
i added this line.but it gives error.how to import it? import org.andengine.opengl.texture.atlas.TextureAtlas;

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.