From: "Jesper Juhl" <jesper.juhl@gmail.com>
To: "Maciej Soltysiak" <solt2@dns.toxicfilms.tv>
Cc: linux-kernel@vger.kernel.org, reiserfs-list@namesys.com
Subject: Re: creating live virtual files by concatenation
Date: Sat, 25 Feb 2006 16:35:55 +0100 [thread overview]
Message-ID: <9a8748490602250735l6161a96dte2805b772a89a436@mail.gmail.com> (raw)
In-Reply-To: <1271316508.20060225153749@dns.toxicfilms.tv>
On 2/25/06, Maciej Soltysiak <solt2@dns.toxicfilms.tv> wrote:
> Hello!
>
> I have this idea about creating sort of a virtual file.
>
> Let us say I have three text files that contain javascript code:
> tooltip.js
> banner.js
> foo.js
>
> Now let us say I am creating sort of a virtual text file (code.js)
> that is a live-concatenation of these files:
> # concatenate tooltip.js banner.js foo.js code.js
>
> Note I am not talking about the cat(1) utility. I am thinking of
> code.js be always a live concatenated version of these three, so when
> I modify one file, the live-version is also modified.
>
> What puprose I might have? Network-related. Say, I have an HTML file
> that includes these three files in its code.
>
> When a browser downloads the HTML file it will then create three threads
> to download each of those javascript files.
>
> If I had a live-concatenated file, I could reference it in the HTML file
> so that the browser does not have to download three files but just one.
>
If that's what you want to accomplish, then you can easily get around
that in several ways.
1. Simply $ cat tooltip.js banner.js foo.js > code.js then include
code.js in your html document and remember to update it when you
change one of the 3 files (or create a script that does it.
2. use Apache's mod_include
3. Use PHP, Perl, python or watever your scripting language of choice
is - here's an example in PHP :
<?php
header('Content-type: text/javascript');
readfile('tooltip.js');
readfile('banner.js');
readfile('foo.js');
?>
save that as javascripts.php then put this in your HTML document :
<script src="javascripts.php" language="javascript"
type="text/javascript"></script>
And there are other ways ...
> This would surely reduce network overhead of downloading the same amount
> of data but within just one connection, reduce resource usage on the client
> and possibly (depending on implementation) reduce the cost of accessing
> three individual files on the server.
>
Negligible I'd say.
> I am CC'ing reiserfs-list because Reiser4 would seem to be the most
> robust filesystem that could have it done.
>
> Any thoughts about the idea itself?
Might be a cute little hack, but I don't think it's a very useful
feature really..
> Would be nice if this idea could inspire some talented hackers here and there.
>
> Best Regards,
> Maciej
>
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
next prev parent reply other threads:[~2006-02-25 15:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-25 14:37 creating live virtual files by concatenation Maciej Soltysiak
2006-02-25 15:30 ` Jan Engelhardt
2006-02-27 19:52 ` Yoanis Gil Delgado
2006-02-25 15:35 ` Jesper Juhl [this message]
2006-02-25 17:15 ` Maciej Soltysiak
2006-02-25 18:40 ` Rik van Riel
2006-02-25 18:52 ` Jesper Juhl
2006-02-25 19:33 ` Re[2]: " Maciej Soltysiak
2006-02-25 22:30 ` Peter Foldiak
2006-02-25 22:38 ` Rik van Riel
2006-02-25 23:23 ` Peter Foldiak
2006-02-27 20:43 ` Hans Reiser
2006-02-27 20:39 ` Hans Reiser
2006-02-27 20:45 ` Jesper Juhl
2006-02-25 17:40 ` Peter Foldiak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9a8748490602250735l6161a96dte2805b772a89a436@mail.gmail.com \
--to=jesper.juhl@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=reiserfs-list@namesys.com \
--cc=solt2@dns.toxicfilms.tv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).