Mobile app version of vmapp.org
Login or Join
Michele947

: Is it possible for a web-server to send more files than requested for, and have the browser accept them? I've created a basic web server for a school project, and it serves static content

@Michele947

Posted in: #Apache #Browsers #Http

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Michele947

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sent6035632

I've found this document, but I've never tried to deal with it.

If your goal is to minimize requests, you can somehow modify your pages (javascripts and stylesheets may be easyly included right into your html, also you can even embed base64-encoded images usind data: URI scheme, like it's described here)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme