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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:13:38+00:00 2026-05-17T02:13:38+00:00

I was under the impression that not calling Response.Flush would ensure that Connection: Close

  • 0

I was under the impression that not calling Response.Flush would ensure that Connection: Close would not be returned. So how do I return Connection: Keep-Alive?

I am using the following code to return a file from ASP.NET.

Response.ContentType = type;
Response.AppendHeader("Content-Length", bytes.Length.ToString());
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
Response.Cache.SetExpires(expiryDate);
Response.Cache.SetLastModifiedFromFileDependencies();
Response.Cache.SetETag(etag);
Response.OutputStream.Write(bytes, 0, bytes.Length);

The Response this generates is:

HTTP/1.1 200 OK
Server: ASP.NET Development Server/9.0.0.0
Date: Fri, 01 Oct 2010 12:50:17 GMT
X-AspNet-Version: 2.0.50727
X-AspNetMvc-Version: 2.0
Content-Length: 34808
Cache-Control: public, must-revalidate
Expires: Fri, 01 Oct 2010 12:51:17 GMT
Last-Modified: Wed, 22 Sep 2010 16:00:33 GMT
ETag: "302E7A7D0D9DA91BABB53F6B6FE0B005"
Content-Type: image/gif
Connection: Close
  • 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-17T02:13:39+00:00Added an answer on May 17, 2026 at 2:13 am

    I’m not sure that you can send connection: Keep-Alive with the development server.

    You can set it in IIS7 by browsing to the “HTTP Response Headers” section in IIS Manager and click the “Set Common Headers…” action on the right.

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

Sidebar

Related Questions

I was under the impression that file objects are immediately closed when their reference
I have a web application that runs fine under IIS5 or IIS6. I just
Android documentation says that AsyncTask postExecute() is called on the UI thread. I was
I noticed that JavaScript's new Date() function is very smart in accepting dates in
In my application I'm pulling back a user's feed. This contains all of that
Alan Kay points out that Unlike Java, [Squeak] runs bit-identical on every machine --
Here's my class: public class UserInformation { public string Username { get; set; }
To summarize the issue I'm encountering, I have an EJB which uses version A
I have a multithreaded Windows application where one of the threads has a message
I'm building a toy database in C# to learn more about compiler, optimizer, and

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.