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?

3
  • 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 <img src="path/to/image.jpg?buster=a_random_number" /> Commented Aug 14, 2014 at 6:33
  • Javascript (hence jQuery) can't clear cache. You can add a queryline parameter for versioning to force a download Commented Aug 14, 2014 at 6:33
  • A good read Cache busting via params Commented Aug 14, 2014 at 6:38

1 Answer 1

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/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.