Showing posts with label jquery read from cache problem. Show all posts
Showing posts with label jquery read from cache problem. Show all posts

Monday, June 23, 2014

jquery http get 결과가 캐시에서 읽어서 항상 같은 값만 가져오는 경우 해결 방법. ( JQuery get method returns values from cache )

problem:  read from cache

$.get('some.jsp', { param_name : param_value } function (responseText)
{
......
}

solution : change url each times.

$.get('some.jsp?dummy='+Math.random() , { param_name : param_value } function (responseText)
{
......
}


캐시에서 가져오지 못하도록 강제로 http get method의 source url 을 호출때마다 다르게 해준다.

( change URL by extra  random value for each get requests. )