|
| ||||||||
|
巻き戻し中。
|
|
2007-09-03(月) 予定が [長年日記]
_ ツール
静的HTML出力用の「正しい」キャッシュ生成のため、こんなツール
#!/bin/sh LIMIT="1000" COUNT="1" while [ "$COUNT" != "$LIMIT" ];do DATE=`/bin/date -v -"$COUNT"d +%Y%m%d` echo $COUNT echo $DATE rm -rf /xxx/xxxx/xxxx/static/$DATE.html #! /bin/sh SERVER=uekusa.jp (cat - <を作ってみた。 sleepは無いと上手くない。 改行も2行ぐらい突っ込んで無いとよろしくない。
RewriteEngine on # If mobile, use index.rb RewriteCond %{REQUEST_URI} ^\/rewind\/([0-9]+)\.html$ RewriteCond %{HTTP_USER_AGENT} ^DoCoMo [OR] RewriteCond %{HTTP_USER_AGENT} ^J-PHONE [OR] RewriteCond %{HTTP_USER_AGENT} ^MOT- [OR] RewriteCond %{HTTP_USER_AGENT} ^KDDI- [OR] RewriteCond %{HTTP_USER_AGENT} ^Vodafone [OR] RewriteCond %{HTTP_USER_AGENT} ^UP\.Browser [OR] RewriteCond %{HTTP_USER_AGENT} ^SoftBank RewriteRule .* index.rb?date=%1 [L] # If mobile, go to index.rb RewriteCond %{REQUEST_URI} ^\/rewind\/$ RewriteCond %{QUERY_STRING} ^$ RewriteCond %{HTTP_USER_AGENT} ^DoCoMo [OR] RewriteCond %{HTTP_USER_AGENT} ^J-PHONE [OR] RewriteCond %{HTTP_USER_AGENT} ^MOT- [OR] RewriteCond %{HTTP_USER_AGENT} ^KDDI- [OR] RewriteCond %{HTTP_USER_AGENT} ^Vodafone [OR] RewriteCond %{HTTP_USER_AGENT} ^UP\.Browser [OR] RewriteCond %{HTTP_USER_AGENT} ^SoftBank RewriteRule .* index.rb [L] # If search engine, goto html focebily RewriteCond %{REQUEST_URI} ^\/rewind\/?date=([0-9]+$) RewriteCond /xxx/xxxx/xxxx/static/%1.html -f RewriteCond %{HTTP_USER_AGENT} msnbot [NC,OR] RewriteCond %{HTTP_USER_AGENT} psbot [NC,OR] RewriteCond %{HTTP_USER_AGENT} Googlebot [NC,OR] RewriteCond %{HTTP_USER_AGENT} Googlebot/2 [NC,OR] RewriteCond %{HTTP_USER_AGENT} Googlebot/1 [NC,OR] RewriteCond %{HTTP_USER_AGENT} Yahoo [NC,OR] RewriteCond %{HTTP_USER_AGENT} Yahoo! [NC,OR] RewriteCond %{HTTP_USER_AGENT} Y!J-SRD RewriteRule .* static/%1.html [L] # If there is cache, output from cache RewriteCond %{REQUEST_URI} ^\/rewind\/([0-9]+\.html$) RewriteCond /xxx/xxxx/xxxx/static/%1 -f RewriteRule .* static/%1 [L] # If there is no cache, output from cgi RewriteRule ^([0-9]+)\.html$ index.rb?date=$1 [L] RewriteRule ^([0-9]+[-]+[0-9]+)\.html$ index.rb?date=$1 [L] # If it is comment, go to index.rb RewriteCond %{REQUEST_URI} ^\/rewind\/$ RewriteCond %{REQUEST_METHOD} ^POST$ RewriteRule .* index.rb [L] # If selecting a category, go to index.rb RewriteCond %{REQUEST_URI} ^\/rewind\/$ RewriteCond %{REQUEST_METHOD} ^GET$ RewriteCond %{QUERY_STRING} ^.+$ RewriteRule .* index.rb [L] # If there is no caache for top, go to index.rb RewriteCond %{REQUEST_URI} ^\/rewind\/$ RewriteCond %{QUERY_STRING} ^$ RewriteCond /xxx/xxxx/xxxx/index.html !-f RewriteRule .* index.rb [L]
Tweets by RC31E | |||||||||
| |||||||||
| |||||||||
|