nginx
nginx
nginx ssi設置
摘要: 一個登錄用戶在頁面訪問的時候如何充分利用 cache?
頁面靜態化的一個大問題是登錄用戶訪問頁面如何靜態化。 例如首頁, 大部分的頁面內容需要緩存但是用戶登錄后的個人信息是動態信息, 不能緩存。 那么如何解決這個"頁面部分緩存"問題?
現有的方案是利用 SSI - Server Side include.
Nginx SSI 實現是 http://wiki.nginx.org/NginxHttpSsiModule
這里最關鍵的就是靜態文件可以包含一個動態的網頁的 URL.
這里有一篇文章對這個問題進行了深入的討論:
http://jimmyg.org/blog/2009/ssi-memcached-nginx.html
文章用了 memcache. 我關心的是 SSI 和 Nginx 自身的 cache 的協同工作。
模塊分析:
1. http://hi.baidu.com/langwan/blog/item/
閱讀全文
posted @
2009-12-22 09:35 冰是沒有未來的,因為它的永恒|
編輯
nginx 通過user-agent判斷是手機的瀏覽器
摘要: user-agent 收集:http://www.developershome.com/wap/detection/detection.asp?page=userAgentHeader
http://search.cpan.org/~cmanley/Mobile-UserAgent-1.05/lib/Mobile/UserAgent.pm
http://www.zytrax.com/tech/web/mobile_ids.html
http://en.wikipedia.org/wiki/List_of_user_agents_for_mobile_phones
nginx
location = / {
root /var/www/path;
if ($http_user_agent ~* "Nokia") { rewrite . /index.html break; }
if ($http_user_agent ~* "Mobile") { r
閱讀全文
posted @
2009-12-08 09:22 冰是沒有未來的,因為它的永恒|
編輯
nginx0.8.8 purge_cache module 中出現...is too small...
摘要: nginx 重啟之后 用purge 會出現以上錯誤
nginx log :
2009/11/17 15:03:52 [crit] 1553#0: *1 cache file "/data/nginx_cache/etwebservice/a/2b/b3a2527b6f3a38d63663ee436e7d82ba" is too small, client: 222.66.142.229, server: localhost, request: "HEAD /purge/RestTakeoutServer/dish/B10I24R57547/list?commentCount=5 HTTP/1.1", host: "222.66.142.229"
客戶端請求出錯
HTTP/1.1 500 Internal Server Error
Server: nginx/0.8.24
Date: Tue, 17 Nov 2009 07:03:52 GMT
Content-Type: text/html
Content
閱讀全文
posted @
2009-11-17 17:59 冰是沒有未來的,因為它的永恒|
編輯
nginx0.8.26 加入 purge_cache module
摘要: nginx0.8.26 加入 purge_cache module
閱讀全文
posted @
2009-11-17 17:45 冰是沒有未來的,因為它的永恒|
編輯
nginx配置rewrite
摘要: 例子 修改$
user syncher syncher;
worker_processes 2;
events {
use epoll; # for linux
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
upstream tomcats {
閱讀全文
posted @
2009-06-17 13:38 冰是沒有未來的,因為它的永恒|
編輯