Is it possible for a web-server to send more files than requested for, and have the browser accept them?

Posted by Osiris on Pro Webmasters See other posts from Pro Webmasters or by Osiris
Published on 2011-06-27T06:59:14Z Indexed on 2011/06/27 8:31 UTC
Read the original article Hit count: 245

Filed under:
|
|

I've created a basic web server for a school project, and it serves static content without a problem.

I thought of having the server parse all htm/html files for links to .js/.css/image files, and send these files to the client without these files being requested by the client later.

eg. The browser requests: index.htm

The server responds with intex.htm and image.jpg

I modified the server to send two distinct http responses for a "GET /index.html HTTP1.1" (one for the html page and one for the image), but the browser ended up requesting the image when it was good and ready. Is there any way to bypass this? (use a multipart response, perhaps)

Will these files be accepted by most browsers, or will they be rejected for security reasons?

© Pro Webmasters or respective owner

Related posts about apache

Related posts about browsers