ASPの強力なアプリケーションはPHPではありません。昨日、私の友人は彼の才能のあるウェブサイトが読むのが遅いと不満を言ったので、私は彼がASPのアプリケーション部分を使用してASPのよりタイムリーな部分を読むのを手伝いました。
関数getCacheは、必要なキャッシュを自動的に確立します。
function getCache(Funname、isreset、isarr、timeinfo)))
'funsname-コンテンツをキャッシュする必要があります。ここに入力する必要があるファンがあります。
'isReset- [値:0(時間または判断キャッシュが空のときに自動的に更新される)を更新するかどうか、1(アクティブ更新)]]
'isarr-cacheのコンテンツがデータであるかどうか[0は文字列、1は配列です]
'TimeInfo-Cacheの更新時間、ユニットは2番目です。値が0の場合、キャッシュが空の場合にのみ更新されます
dim domain = cnzhaopin.com.cn
dimp_getconfig
dim re_getCache:re_getCache = false
dimp_isaray_type:temp_isarray_type = false
dim appfunsname:appfunsname = cheplage(leplage(funsname、(、)、)、),,,,,,,,,,,,,!
ISARR = 1の場合、temp_isarray_type = true
isReset = 1の場合、re_getCache = true
isReset = 2の場合
execute(temp_getconfig =&funsname)
getCache = temp_getConfig
出口機能
ifを終了します
application(domain&_&appfunsname&_time)= and timeinfo <> 0、re_getcache = true
re_getcacheではない場合
temp_isarray_typeの場合
ISARRAY(Application(domain&_&_&appfunsname))にない場合はre_getcache = true
それ以外
application(domain&_&appfunsname)= then re_getcache = true
ifを終了します
ifを終了します
そうでない場合は、re_getcacheとtimeinfo <> 0では
int(s、application(domain&_&_&_&appfunsname&_time)、now())> timeinfo then re_getcache = true
ifを終了します
re_getCacheの場合
execute(temp_getconfig =&funsname)
Application.Lock
Application(domain&_&appfunsname)= temp_getConfig
アプリケーション(domain&_&appfunsname&_time)= now()
Application.UnLock
それ以外
temp_getConfig = application(domain&_&appfunsname)
ifを終了します
getCache = temp_getConfig
エンド関数
使用する場合:
関数出力3
output3 =
newrs = const.executeを設定します(Top 60 CompanyName、comid、vipdata、iShotを選択します。 ())
newrs.eofではありません
output3 = output3&..........
Newrs.movenext
ループ
Newrs.close
News = Nothingを設定します
エンド関数
Response.Write getCache(output3″、0,0,3600)