Making fast images request/response

71 views
Skip to first unread message

lars

unread,
Jul 13, 2012, 7:30:58 AM7/13/12
to we...@googlegroups.com


Hi
Whats the best way for creating fast non static images request/response?
Using
GET(self):
   return open('image').read()

uses IO is it better to read and store all the images in a dict and what is the best buffer to store the images with?
images = {}
images[image] = open('image').read()

GET(self,image):
  return images[image]




Andrey Kuzmin

unread,
Jul 13, 2012, 9:10:47 AM7/13/12
to we...@googlegroups.com
Its better to serve them through web server, it is possible to do it with either nginx or apache, your webpy should return special header so web server knows which file to send.

qinmugong

unread,
Aug 13, 2012, 7:34:41 PM8/13/12
to we...@googlegroups.com
static content would be served by web server, need more fast? add a cache like varnish ,squid
Reply all
Reply to author
Forward
0 new messages