Subject: Headers

From: "Ajay" <[email-masked]>
Date: Tue, 4 Sep 2001 15:01:45 +0530

i m writing a small web server. i just want to know that when the client downloads something it should first check in the cache and if it is in the cache it  should download from the cache . accroding to me to enable  this u have to pass some headers which include last modified date .But when i pass the header like http/1.0 200 ok , after sending this i send the page . but it appears as junk char in the html page . can anyone tell me where i m going wrong

Ajay

***************************************************************
MicroWorld Software Services Pvt Ltd (MSSPL)
Web :       http://www.mspl.net
E-Mail :    [email-masked]
Phones    : +91-22-826 5701 to 826 5705/35/36/39/40
Fax       : +91-22-830 4750

MailScan  : Content Security for your EMail Servers and Gateways
eScan     : Content Security for your Workstations and File-Servers

eScan & MailScan are the world's first "real-time" Content-Security
and  Virus  Scanner products, using the  MicroWorld Winsock Layer 
(MWL) Technology.
***************************************************************

---

From: "Joris Dobbelsteen" <[email-masked]>
Date: Fri, 7 Sep 2001 15:35:43 +0200

Did you read RFC2616 (HTTP/1.1 specification). This document included all
the information needed to create a HTTP/1.1 implementation. It's recommended
for new implementations to support HTTP/1.1.
HTTP/1.1 is backwards compatible with HTTP/1.0. Please see RFC2616 for more
information.

You can get RFC2616 from http://www.ietf.org/.

Some information about the HTTP/1.1 caching mechanism:

Client request page.
Server send page and may send information like:
modified date (not relevant for cache),
pragma: no-cache (HTTP/1.0 do not cache document)
cache-control header (HTTP/1.1 caching mechanism)
expires header (HTTP/1.1 document expiration info)
Vary header (HTTP/1.1 dynamic content information)

Note that a client can make a request with:
 * if-modified header
 * ETag (???) header
These are added by the client to check for the latest available document
version. If the client has indeed the latest version, the server should
respond with: 304 Not Modified. Otherwise the server should return the
document (200 OK response).

You should definitly read RFC2616 for information about this.
I can't explain it in a short mail and I won't write a long one, since you
can find everything you could possibly need quite clear in the RFC.

Please take care you be compatible with the HTTP/1.0 caching mechanism. Also
ensure you support filtering the CRLF before the startline. This ensures

- Joris

>-----Original Message-----
>From: Ajay [mailto:[email-masked]]
>Sent: Tuesday, 04 September 2001 11:32
>To: [email-masked]
>Subject: Headers
>
>i m writing a small web server. i just want to know that when
>the client downloads something it should first check in the
>cache and if it is in the cache it  should download from the
>cache . accroding to me to enable  this u have to pass some
>headers which include last modified date .But when i pass the
>header like http/1.0 200 ok , after sending this i send the
>page . but it appears as junk char in the html page . can
>anyone tell me where i m going wrong
>
>Ajay
>
[SNIP]