頁面緩存處理的幾種方法

html
只要加在頭部就可以了.


<HEAD>?
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">?
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">?
<META HTTP-EQUIV="Expires" CONTENT="0">?
</HEAD>

說明:HTTP頭信息“Expires”和“Cache-Control”為應用程序服務器提供了一個控制瀏覽器和代理服務器上緩存的機制。HTTP頭信息Expires告訴代理服務器它的緩存頁面何時將過期。HTTP1.1規范中新定義的頭信息Cache-Control可以通知瀏覽器不緩存任何頁面。當點擊后退按鈕時,瀏覽器重新訪問服務器已獲取頁面。如下是使用Cache-Control的基本方法:

  1) no-cache:強制緩存從服務器上獲取新的頁面

  2) no-store:?在任何環境下緩存不保存任何頁面

  HTTP1.0規范中的Pragma:no-cache等同于HTTP1.1規范中的Cache-Control:no-cache,同樣可以包含在頭信息中。

在需要打開的url后面增加一個隨機的參數:

增加參數前:url=test/test.jsp

增加參數后:url=test/test.jsp?ranparam=random()

說明:因為每次請求的url后面的參數不一樣,相當于請求的是不同的頁面,用這樣的方法來曲線救國,清除緩存。

asp教程做法


Response.Buffer = True?
Response.ExpiresAbsolute = Now() - 1?
Response.Expires = 0?
Response.CacheControl = "no-cache"?
Response.AddHeader "Pragma", "No-Cache"

php教程做法


<?php?
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');?
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');?
header('Cache-Control: no-cache, must-revalidate');?
header('Pragma: no-cache');?
?>

轉載于:https://www.cnblogs.com/sdfgdrg/p/10289342.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/278445.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/278445.shtml
英文地址,請注明出處:http://en.pswp.cn/news/278445.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Nginx的Mainline version、Stable version、Legacy version的版本區別

Nginx官網提供了三個類型的版本Mainline version&#xff1a;Mainline 是 Nginx 目前主力在做的版本&#xff0c;可以說是開發版Stable version&#xff1a;最新穩定版&#xff0c;生產環境上建議使用的版本Legacy versions&#xff1a;遺留的老版本的穩定版 nginx下載地址&…

從Boxee的Amie Street訪問音樂

One of our favorite sites for discovering new music is Amie Street. Today we take a look at the Amie Street app for Boxee that allows you to access your favorite tunes from the Boxee interface. 我們最喜歡的發現新音樂的網站之一是Amie Street。 今天&#xff0…

redis學習目錄

redis學習目錄 redis安裝 說明 python中使用 centos7安裝redis redis.conf配置信息詳解 redis主從同步 redis持久化 RDB與AOF redis不重啟,切換到RDB備份到AOF備份 redis哨兵功能 redis-cluster(集群) 轉載于:https://www.cnblogs.com/yuncong/p/10293624.html

如何在SpringBoot項目中使用攔截器

相比springmvc&#xff0c;springboot中攔截器不需要在xml中配置&#xff0c;只需定義攔截器類 implements HandlerInterceptor 和攔截器攔截路徑的配置類extends WebMvcConfigurerAdapter 1.SessionInterceptor package com.example.demo;import org.springframework.web.serv…

如何在Word,Excel和PowerPoint 2010中裁剪圖片

When you add pictures to your Office documents you might need to crop them to remove unwanted areas, or isolate a specific part. Today we’ll take a look at how to crop images in Office 2010. 將圖片添加到Office文檔時&#xff0c;可能需要裁剪它們以刪除不需要…

Python 調度算法 死鎖 靜動態鏈接 分頁分段

1 select poll epoll的區別基本上select有3個缺點: 連接數受限查找配對速度慢數據由內核拷貝到用戶態poll改善了第一個缺點 epoll改了三個缺點. (1&#xff09;select&#xff0c;poll實現需要自己不斷輪詢所有fd集合&#xff0c;直到設備就緒&#xff0c;期間可能要睡眠和喚醒…

在Windows 7 Media Center中創建音樂播放列表

One of the new features in Windows 7 Media Center is the ability to easily create music playlists without using Media Player. Today we’ll take a closer look at how to create them directly in Media Center. Windows 7 Media Center的新功能之一是無需使用Media …

(轉)WebSphere的web工程中怎么獲取數據源

原文&#xff1a;http://aguu125.iteye.com/blog/1694313 https://blog.csdn.net/bigtree_3721/article/details/44900325-------JNDI之java:comp/env was配置數據源和tomcat是不同的。tomcat只需要配置tomcat 的service.xml或者content.xml&#xff0c;然后 WEB程序就不需要配…

阿里數據庫內核月報:2017年04月

摘要&#xff1a;阿里數據庫內核月報&#xff1a;2017年04月# 01 MySQL 源碼分析 MySQL 半同步復制數據一致性分析# 02 MYSQL 新特性 MySQL 8.0對Parser所做的改進# 03 MySQL 引擎介紹 Sphinx源碼剖析&#xff08;二&#xff09;# 04 PgSQL 特性分析 checkpoint機制淺析…

SQL Server2008導入導出數據庫

一、導出數據庫 1.新建一個.bak的文本 右擊數據庫--》Tasks--》BackUp--》Remove原來的數據庫--》Add后選擇之前建立的.bak檔 二、導入數據庫 1.右擊數據庫--》Tasks--》Restore--》Database--》From device--》勾選數據庫之后--》點擊左上角Options--》點擊 --》OK覆蓋 轉載于…

如何使YouTube視頻連續循環播放

Should you need a YouTube video on a continuous loop, a few methods can help you keep repeating a video without having to start it over manually. Here’s how to do it. 如果您需要連續循環播放YouTube視頻&#xff0c;可以采用以下幾種方法來繼續播放視頻&#xff…

Android ABI

2019獨角獸企業重金招聘Python工程師標準>>> 獲取當前ABI var supportsABIs:Array<String>? null if(Build.VERSION.SDK_INT > 21) {supportsABIs Build.SUPPORTED_ABIS } var currentABI Build.CPU_ABI 通過Build可以獲取當前手機支持的abi集以及cpu的…

nginx限流健康檢查

Nginx原生限流模塊:ngx_http_limit_conn_module模塊根據前端請求域名或ip生成一個key&#xff0c;對于每個key對應的網絡連接數進行限制。配置如下:http模塊server模塊#http模塊內 http {include mime.types;default_type application/octet-stream;log_format main [$t…

如何在Ubuntu上創建桌面快捷方式

Desktop icons should be simple, but they’re not on Ubuntu 18.04 LTS and newer releases like Ubuntu 19.10. Follow these easy steps to get desktop shortcuts for your favorite applications, just like on other operating systems and other Linux desktops. 桌面圖…

阿里再破記錄!代表中國企業首次在這項國際比賽中摘得銀牌!

2月9日在洛杉磯舉行的第11屆網絡搜索與數據挖掘國際會議&#xff08;WSDM 2018&#xff09;上&#xff0c;公布了今年的WSDM Cup競賽成績&#xff0c;來自阿里巴巴的AliOS團隊憑借優秀的算法能力&#xff0c;摘得榜眼。這是該賽事舉辦11屆以來&#xff0c;中國企業在該賽事上首…

關于IE 對 $.get 緩存的記錄

最近在IE9中碰到一個問題是&#xff0c; 當我對某個角色進行修改的時候&#xff0c;再點擊查詢還是修改之前的內容&#xff0c;但是實際數據庫已經修改成功&#xff0c;糾結了好一會兒之后&#xff0c;才發現是 $.get請求的問題。 因為 IE對get請求&#xff0c;如果請求url 相…

閃存驅動器_將閃存驅動器變成便攜式Web服務器

閃存驅動器Portable applications are very useful for getting work done on the go, but how about portable servers? Here’s how you can turn your flash drive into a portable web server. 便攜式應用程序對于在旅途中完成工作非常有用&#xff0c;但是便攜式服務器呢…

Android中文API-ViewStub

ViewStub控件是一個不可見&#xff0c;0尺寸得惰性控件。當ViewStub控件設置可見&#xff0c;或者調用inflate()&#xff0c;并運行完畢之后&#xff0c;ViewStub所指定的layout資源就會被載入。這個ViewStub就會被新載入的layout文件取代。ViewStub也會從其父控件中移除。因此…

如何播放梅西百貨的感恩節大游行2019

Macy’s梅西百貨As we draw ever closer to the Thanksgiving holiday, multiple things come to mind: turkey, Black Friday, and the Macy’s Thanksgiving Day Parade. With that in mind, you might want to find a way to stream it for your family. 隨著我們越來越接近…

thinkpaidE480office安裝文件夾

C:\Program Files (x86)\Microsoft Office\root\Office16需要嵌入office的小伙伴自行百度吧教程吧&#xff0c;網上有很多的轉載于:https://www.cnblogs.com/hgyzm/p/10303449.html