Server side solution: Set the HTTP headers of the response to avoid returning response from cache.In JSP: (before writing to the output stream)response.setHeader(”Cache-Control”,”no-cache”);
response.setDateHeader (”Expires”, 0);Client side solution: (1) Make HTTP POST call — only HTTP GET calls are served from cache or (2) Make sure the HTTP GET URL is different every time.(1) Make HTTP POST call –
set method=”POST” and handle the call appropriately(2) Append a unique parameter to the HTTP GET call so that the URL is different every time. A unique time stamp is a good choice.
The following sample code, may do the job:var timeStampForNocache:Date = new Date() ;
params.noCacheControlVar = timeStampForNocache.getTime().toString() ;
I have named the parameter “noCacheControlVar”. You can name it anything else you please. The name does not matter. What matters is that the timestamp makes the HTTP GET URL unique.
httpservice cache
精选 转载下一篇:炒股就那么几招
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
深入学习cache--思考篇
ARMv8/ARMv9架构精选系列
v8 v9 个人博客 -
Python手写TTL Cache(带过期自动淘汰功能)
用Python实现了一个支持过期时间、带过期自动淘汰功能的Cache
Python TTL Cache -
HTTPService发送POST 请求
httpservice post请求,form表单提交 json格式传参数
http service post -
FLEX实践—XML HttpService加载错误
port mx.rp
xml flex application function integer