开发者

expires max caches ajax

开发者 https://www.devze.com 2023-01-13 07:22 出处:网络
Using rails nginx with passenger. I put the following in the nginx.conf file fo开发者_运维百科r caching images, js. etc. But now I notice that my ajax calls are cached or rather the expiration is set

Using rails nginx with passenger. I put the following in the nginx.conf file fo开发者_运维百科r caching images, js. etc. But now I notice that my ajax calls are cached or rather the expiration is set to some 30 years in future. I would like to have the javascripts cached but not the ajax calls. How do I do it?

location ~* ^.+.(jpg|jpeg|gif|png|css|js|swf)?([0-9]+)?$ {
        expires max;
        passenger_enabled on;
}

I am seeing this on firefox 3.5


Well I just set the cache:false in

jQuery.ajaxSetup({
        cache: false,
        'beforeSend': function (xhr) {
          xhr.setRequestHeader("Accept", "text/javascript")
        }
      });
    });

If there is a better way or if this works against memcaching please let me know.

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号