Is there any simple way of telling Linux to keep a directory of files cached in memory?
I realized that Node.Js and Apache are spending most time on file I/O, making users wait if you have a lot of files (especially for script and template files; the database does an OK job of caching things as needed, if tables are not too large). Of course, you are supposed to use Squid or other ways of speeding things up, but that requires a lot of configuration, and cannot be easily done automatically, and my focus is on "deployability" (Even an interactive installation would require too much from your average user. Of course, all security considerations must be taken care of (including automatic patching of the included httpd's configuration).).
Memory mapping files, on the other hand should be a breeze, since you really just want to tell the system: "Hey, just keep that file in memory until I tell you to drop it or until reboot"; or even some intrusive API that gets its hooks right into relevant POSIX or system calls and does exactly that in user space. Is it that simple? I cannot seem to find some simple code snippet or set of instructions to get that done (not for Linux or Windows).
Help would be much appreciated!