As we know that the memory is faster than the disk.
So I wonder if I can store the frequently requested files such as js / css / icons into memcache, and write a script such as php to get them from memcache to browsers instead of the normal way that server software read from disk.
I know that will make extra spend of executing php. But compare with slow speed of disk I/O, which is better.
There would be absolutely no point in doing this.
First, your OS’ filesystem cache is good enough and will cache the files that really being accessed frequently already.
Next, the approach will actually make your site slower and more bandwidth-eater. While you are going to serve the files themselves, your webserver would often send merely an HTTP header instead of the file body.
Also, you will eat up a number of php-workers which is really precious and limited resource for the highload server.
Finally, premature optimization is a root of all evil.
If you want your files to be served really fast, move them to some sort of CDN.