Archive

Posts Tagged ‘Lighttpd optimization mod expire’

Lighttpd optimization with mod expire to controls the expire http header

Lighttpd comes with mod_expire which controls the Expire header in the Response Header of HTTP/1.0 messages. It is useful to set it for static files which should be cached aggressively like images, stylesheets or similar.

Step 1:
# vi /etc/lighttpd/modules.conf
bạn khai báo modules tải mode_expire khi chạy như hình sau:
lighttpd performance

và bỏ dấu # để khai bái với modules là nap mod_expire như hình sau:
lighttpd optimization

Step 2:
# vi /etc/lighttpd/conf.d/expire.conf
Bạn cache một số thư mục ít cập nhật như css, js, images,..vv
như ví dụ sau:

lighttpd mod expire

sau đó restart lại lighttpd

# service lighttpd restart

Ví dụ trên sẽ tối ưu lighttpd khi client mở web.

nhantam
PHP Developer