Storing images in memory for faster request/response

9 views
Skip to first unread message

lars

unread,
Jul 13, 2012, 5:54:07 AM7/13/12
to we...@googlegroups.com


Hi
Whats the best way to speed up the non static images request/response insteed of making io read call is it better to read all the images on startup to a dictonary in memory.
What is the best buffer type to store the read content with?


class Images:

def GET(self,name):
    .....logic...
   return open(name).read()



#startup
dict ={}
def __init__(self):
     for i in os.listDir():
         dict[name] = open(name).read()

class imagesTestDict:
    GET(self,name)
        return dict[name]
Reply all
Reply to author
Forward
0 new messages