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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:42:33+00:00 2026-06-03T19:42:33+00:00

what is the different between the two lines below? : Response.Cache.SetCacheability(HttpCacheability.NoCache); and Response.CacheControl =

  • 0

what is the different between the two lines below? :

Response.Cache.SetCacheability(HttpCacheability.NoCache);

and

 Response.CacheControl = "no-cache";
  • 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-06-03T19:42:34+00:00Added an answer on June 3, 2026 at 7:42 pm

    If you read through the documentation, generally, there isn’t any difference at all.

    However, since the former uses the Cache object (HttpCachePolicyBase in Asp.Net 4 or Asp.Net MVC) it provides:

    a) An abstraction over the response object’s caching policy that can be useful in testing scenarios

    b) Potential future-proofing if the HTTP spec is extended for some reason to mean that NoCache needs more headers in the response, or other tweaks to the response.

    It also allows the notion of ‘non-cacheability’ to be adapted according to the capabilities of the client transparently; which is important in the case that HTTP does evolve – but also already in the case of HTTP 1.0 and 1.1 clients (differences between 1.0 and 1.1 are well-summarised in HTTP 1.0 vs 1.1).

    In the second line, you are taking responsibility for how the no-cache directive is applied (using a somewhat magic string) – granted, it’s still testable, but if the HTTP spec does change then you have to code around it yourself.

    Ultimately, it’s better design to use the Response.Cache object than to code the headers directly (it really comes into its own for ETags and If-Not-Modified-Since handling, for example).

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

Sidebar

Related Questions

For my application I need to calculate an angle between two different lines: 1)
What is difference between this two lines, they are in different apps but first
is it possible to have different colored tree lines between two sibling nodes? I
What is the difference between the two lines of code below: CComPtr< IInterface >
Could someone please explain the difference between the following two lines of code: 1.
I need to be able to extract the different between two hex colours, represented
What are the different between this two diff statement? Any reference document? '{<table width=100%
In javascript, is there any different between these two: // call MyFunction normal way
tl,dr:How can I rotate between two different pages in my DIV? Hi, I am
How can I pipe between two separate console application running in different console windows?

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.