web层的尝试:
javascirpt代码,通过ajax添加请求头,可以达到返回304 not modify,但是需要js自行把数据缓存,否则返回后没有数据展示。
// var date = date_ddmmmyy(new Date(Date.parse(document.lastModified)));
// var time = document.lastModified.substring(document.lastModified.indexOf(" "));
// heads ={'Last-Modified':date+time};
//set the last-modify-head
if(heads){
if(heads['Last-Modified'])
this._request.setRequestHeader("If-Modified-Since",heads['Last-Modified']);
}
//set the last-modify-hea
//
// format date as dd-mmm-yy
// example: 12-Jan-99
//
function date_ddmmmyy(date)
{
var d = date.getDate();
var m = date.getMonth() + 1;
var y = date.getYear();
// handle different year values
// returned by IE and NS in
// the year 2000.
if(y >= 2000)
{
y -= 2000;
}
if(y >= 100)
{
y -= 100;
}
// could use splitString() here
// but the following method is
// more compatible
var mmm =
( 1==m)?'Jan':( 2==m)?'Feb':(3==m)?'Mar':
( 4==m)?'Apr':( 5==m)?'May':(6==m)?'Jun':
( 7==m)?'Jul':( 8==m)?'Aug':(9==m)?'Sep':
(10==m)?'Oct':(11==m)?'Nov':'Dec';
return "" +
(d<10?"0"+d:d) + "-" +
mmm + "-" +
(y<10?"0"+y:y);
}
后台java处理
org.springframework.web.context.request.WebRequest
//check is modify
if(webRequest.checkNotModified(lastModifyTime)){
return null;
}
分享到:
相关推荐
lastModify
File modifyHeaders = new File(pluginPath); profile.addExtension(modifyHeaders); profile.setPreference("modifyheaders.headers.count", 1); profile.setPreference("modifyheaders.headers.action0", ...
modify-http-headers Chrome插件, 测试可用,包含插件安装文档
一款谷歌浏览器插件,辅助http头注入的检测,欢迎喜欢的朋友下载
Windows环境下IDEA等JetBrains系列软件自动更新文件最后编辑时间(update last modify time)方案-附件资源
前端开源库-less-modify-var-loader修改var加载器更少,webpack加载器更好地替换更少的变量
EMI application notes_Modify-printpdf,EMI application notes_Modify-print
实用小程序工具 之 批量修改文件名 csdn博客地址: https://gudianxiaoshuo.blog.csdn.net/article/details/112724711
Modify Header Value (HTTP Headers) 这个插件的主要作用是对Chrome的HTTP request headers进行添加、修改和过滤等操作。当我们访问网站的时候,某些网站服务器会对访问网站的浏览器Header信息进行判断,然后决定用...
Modify MergeSort, which makes the original MergeSort quicker. In the Modifies, combines the InsertionSort, is a kind of new idea to complich.
SAP自学系列-后勤系统报表查询(Modify)[定义].pdf
modify_headers-0.7.0.2-fx+sm.xpi
ubuntu下su运行,所有文件需要可以执行权限。 ./modify.sh e rom.trx是解包解包后不要忘了给squashfs-root/文件夹读写权限 ./modify.sh c newrom.trx是打包
炬力ATS2825\ATS2823\ATS2819固件修改工具Media Firmware Modify Tool V1.16.rar
可以修改PC机的逻辑盘的序列号。使用后,可以恢复。
我们在做游戏资源或者其他资源的时候,经常要用到加密。否则游戏资源包被破解之后游戏资源就公开可见了,所以需要用到这款MD5加密软件,非常的好用
由于ubuntu12.04弃用了ssl2.0,所以在安装python2.6.6时会提示failed to install _ssl,因此需要对python2.6.6的安装文件做部分修改,将本文件解压,文件夹内容直接替换python2.6.6的安装文件下,在编译python2.6.6...
php出现Cannot modify header information的解决方法