设置页面不默认缓存方法

阅读更多

    HTTP:
  
  
  
  
  ASP
  response.expires=0
  response.addHeader("pragma","no-cache") 
  response.addHeader("Cache-Control","no-cache, must-revalidate")
  PHP
  header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  header("Cache-Control: no-cache, must-revalidate");
  header("Pragma: no-cache");
  JSP:
  response.addHeader("Cache-Control", "no-cache");
  response.addHeader("Expires", "Thu, 01 Jan 1970 00:00:01 GMT");

 

asp获取真实IP方法:

     

Function getIP()
  Dim strIPAddr
  If Request.ServerVariables("HTTP_X_FORWARDED_FOR") = "" OR InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), "unknown") > 0 Then
  strIPAddr = Request.ServerVariables("REMOTE_ADDR")
  ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",") > 0 Then
  strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",")-1)
  ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";") > 0 Then
  strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";")-1)
  Else
  strIPAddr = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
  End If
  getIP = Trim(Mid(strIPAddr, 1, 30))
End Function

 

 

你可能感兴趣的:(asp,页面)