/browse: Force AJAX requests to never be cached as the user has no way of requesting a refresh for them.

This commit is contained in:
Kovid Goyal 2010-10-20 22:12:50 -06:00
parent 1c2ff97a5d
commit 8f371fdd4f
2 changed files with 6 additions and 0 deletions

View File

@ -156,6 +156,7 @@ function category() {
if (href) {
$.ajax({
url:href,
cache: false,
data:{'sort':cookie(sort_cookie_name)},
success: function(data) {
this.children(".loaded").html(data);
@ -212,6 +213,7 @@ function load_page(elem) {
url: href,
context: elem,
dataType: "json",
cache : false,
type: 'POST',
timeout: 600000, //milliseconds (10 minutes)
data: {'ids': ids},
@ -263,6 +265,7 @@ function show_details(a_dom) {
$.ajax({
url: book.find('.details-href').attr('title'),
context: bd,
cache: false,
dataType: "json",
timeout: 600000, //milliseconds (10 minutes)
error: function(xhr, stat, err) {

View File

@ -168,6 +168,9 @@ class Endpoint(object): # {{{
sort_val = cookie[eself.sort_cookie_name].value
kwargs[eself.sort_kwarg] = sort_val
# Remove AJAX caching disabling jquery workaround arg
kwargs.pop('_', None)
ans = func(self, *args, **kwargs)
cherrypy.response.headers['Content-Type'] = eself.mimetype
updated = self.db.last_modified()