使用jQuery清除浏览器缓存 [英] Clear browser cache using jQuery

查看:1202
本文介绍了使用jQuery清除浏览器缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的迷你项目中,我试图裁剪一个已经上传的图像,然后在图库页面中显示裁剪后的图像来代替原始图像.但是,当我完成裁剪后,当我重定向到图库页面时,即使显示刷新页面也无法正常显示原始图像.我必须清除浏览器的缓存才能查看裁剪后的图像.我可以使用jQuery清除浏览器的缓存吗?

In my mini project i'm trying to crop an already uploaded image and then show the cropped image in place of the original image in the gallery page. But after I'm done with cropping i'm shown the the original image when i'm redirected to the gallery page even refreshing the page doesn't work. I have to clear the browser's cache in order to see the cropped image. Can i clear the browser's cache using jQuery?

推荐答案

仅通过此链接,不可能清除缓存,但可以通过使用无缓存"元标记或在HTTP标头中阻止它.但也可以通过使用参数,刷新等或javascript文件名版本控制来做到这一点,以便浏览器始终下载它.

Just go through this link, it is not possible to clear cache but can prevent it by using metatag "no cache" or either in http headers. but alternatively can do this by using parameters,refreashing etc. or javascript file name versioning so browser will download it always.

http://www.sitepoint.com/forums/showthread.php?866717-How-to-force-the-user-s-browser-to-clear-its-cache

http://www.sitepoint.com/caching-php-performance/

这篇关于使用jQuery清除浏览器缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆