Thank you for visiting!

Please consider subscribing to the RSS feed or following me on Twitter.

AJAX Get and Cache

Recently I fetched a MVC view with AJAX GET ($.get()) and it worked most of the time in most browsers. However at times I got a cached version of the view.

How to solve this? Easy. Just switch to $.ajax and add cache: false to your AJAX request:

	url: '/shop/cart',
	cache: false,
	success: function (data) {

AJAX calls are by standard GET so there's no need to specify it. Above is enough.

To the top