I have web application of which major part is javascript.
I request images from the disk and rendered on the UI, it is a kind of ebook reader application. For every page of ebook I have corresponding image saved on the disk.
No my application has performance hit, it has very high disk io specifically disk read operation. To improve disk read operation, I am planning to use memcache.
So now i wanted to use memcache with by javascript calls to fetch images from memcache rather from disk. Guide me through this…
Thanks
Suppose your javascript is being used at browser-side, then you have to write some http server-side code to wrap image getting operation. Modifying only javascript code will do nothing.
For example, originally you request
http://example.com/ebook1/page1.jpg, you should change it tohttp://example.com/ebook1/get_page.php?page=1(suppose you implement it in php), and use memcache inside that php.For server-side js, there are several memcache lib built on node.js