Menu:

Delicious!

arrow Drawing with jquery

arrow Mobile applications RIP

arrow Lighthttpd tuning

arrow Kännykästä WLAN tukiasema

arrow MySQL advanced performance tips

 left_thumb_25102008-002.jpgleft_thumb_24102008-032.jpgleft_thumb_24102008-015.jpgleft_thumb_24102008-013.jpgleft_thumb_20092008.jpg 

Dezign
(4 Janv, 2007)

MidCOM 3 supports now X-Sendfile

Posted on 2008-09-01 12:54:10 EEST.


Normally serving files directly from PHP can be quite resource consuming. X-Sendfile provides an alterntive way to serve files from PHP script. It's quite simple, you just send one more header line after setting your content type.

Apache's X-Sendfile module then intercepts the header and does it magic. Module also provides caching headers etc to the browser.

Setting things up is simple
  1. Download the module from mod_xendfile's page
  2. Compile and install it in your apache and do apache restart
  3. Add following line to your MidCOM 3's configuration
    - enable_xsendfile: true
Then all attachments should be served via xsendfile. It's a bit faster and on the second load when the browser cache hits in, it's even faster.

Pros:
  • Fast and low memory consuption when serving very large attachements
  • Allow using ACL's before serving
Cons:
  • Not an official apache module. Needs some tweaking.
  • File or any file is served without any intervention of Midgard or Midcom. So if you xsendfile directly, be careful!

Related stories

Back