3

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?

Xylon
  • 461
  • 4
  • 11
  • 20
  • 1
    The common way to deal with this is to load the image with a random query string value preventing it from being pulled from cache, such as `` – sberry Aug 14 '14 at 06:33
  • Javascript (hence jQuery) can't clear cache. You can add a queryline parameter for versioning to force a download – JNF Aug 14 '14 at 06:33
  • A good read [Cache busting via params](http://stackoverflow.com/questions/9692665/cache-busting-via-params) – Satpal Aug 14 '14 at 06:38

1 Answers1

2

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/

ataravati
  • 8,891
  • 9
  • 57
  • 89
Aksh
  • 654
  • 6
  • 13