changeset 405:6244bbb72400

Remove cache time stamp only when img data stream sent
author HIROSE Yuuji <yuuji@gentei.org>
date Wed, 08 Feb 2017 12:53:20 +0900
parents 084a4d35c98f
children 1af18eeeffb3
files s4-blog.sh
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/s4-blog.sh	Wed Feb 08 12:24:18 2017 +0900
+++ b/s4-blog.sh	Wed Feb 08 12:53:20 2017 +0900
@@ -246,6 +246,7 @@
 	  fi
 	fi
      
+	date "+%F %T" > $stampfile # Cache time stamp(is here good?)
 	cat<<EOF
 <tr id="$id">
 <td class="$tdcls">$picon${edit:+<a href="$elink+$edit">編集</a> }#$aid
@@ -283,7 +284,6 @@
 		$fnb</a>
 		EOF
 		# !!NOTE!! Create row stamp ONLY WHEN imgcache is active
-		date "+%F %T" > $stampfile
 	      else
 		query "SELECT hex(bin) FROM article_m WHERE rowid=$mrid;" \
 		    | unhexize \
@@ -295,6 +295,7 @@
 	    		  -e "s|^|<a href=\"$catlink+$mrid\"><img src=\"data:image/$fmt,|" \
 			  -e "s|\$|\">$fnb</a>|"
 		# [ -d $td ] || mkdir -p "$td"
+		rm -f "$stampfile" # img data stream is not suitable to cache
 		echo $tm > $tsfile
 	      fi
 	      ;;

yatex.org