ASP의 강력한 응용 프로그램은 PHP에 없습니다. 어제, 내 친구는 자신의 재능 웹 사이트가 읽기가 느리다고 불평했기 때문에 ASP의 응용 프로그램 부분을 사용하여 ASP의 더시기 적절한 부분을 읽도록 도와주었습니다.
기능 getCache는 필요한 캐시를 자동으로 설정합니다.
함수 getCache (funname, isreset, isarr, timeinfo))))
'funsname- 컨텐츠를 캐시해야합니다. 여기에 입력 해야하는 팬이 있습니다.
'ISRESET- 업데이트 할 때 [값 : 0 (빈시기에 자동으로 업데이트 할 시간 또는 판단 캐시 기준), 1 (활성 업데이트)]
'ISARR- 캐시의 내용은 데이터입니다 [0은 문자열, 1은 배열입니다]
'TimeInfo-cache 업데이트 시간, 단위는 두 번째입니다. 값이 0 인 경우 캐시가 비어있을 때만 업데이트됩니다.
Dim Domain = cnzhaopin.com.cn
희미한 temp_getConfig
dim re_getCache : re_getCache = false
dim temp_isaray_type : temp_isarray_type = false
dim appfunsname : appfunsname = replace (replace (replace (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) = 및 TimeInfo <> 0 인 경우 re_getCache = true
re_getCache가 아니라면
temp_isarray_type라면
ISARRAY가 아닌 경우 (응용 프로그램 (Domain & _ & AppFunsName)) 그런 다음 re_getCache = true
또 다른
Application (domain & _ & appfunsname) = 그런 다음 re_getCache = true 인 경우
끝 If
끝 If
re_getCache 및 timeInfo <> 0이 아닌 경우
int (datingiff (s, application (domain & _ & appfunsname & _time), now ())> timeinfo re_getCache = true 인 경우.
끝 If
re_getCache 인 경우
execute (temp_getConfig = & funsname)
application.lock
응용 프로그램 (Domain & _ & AppFunsName) = temp_getConfig
응용 프로그램 (도메인 & _ & appfunsname & _time) = now ()
application.unlock
또 다른
temp_getConfig = application (domain & _ & appfunsname)
끝 If
getCache = temp_getConfig
엔드 기능
사용될 때 :
함수 출력 3
출력 3 =
set newrs = const.execute (isok = 1 및 vipqx> 60 및 vipqx <300 및 vipqx <300 및 vip = 1 인 회사에서 온 회사에서 상위 60 대 기업 이름, comid, vipdata, ishot을 선택하고 zt <> 1). ())
newrs.eof가 아닙니다
output3 = output3 & ............
newrs.movenext
고리
newrs.close
뉴스 = 아무것도 없습니다
엔드 기능
응답. getCache (output3 ″, 0,0,3600)