Active
Project:
Boost
Version:
6.x-1.18
Component:
Core compatibility
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 May 2010 at 19:12 UTC
Updated:
17 Jan 2012 at 01:47 UTC
I enable boost json cache and it works great. But some browsers(ie6 i know at least) cache it in the browser cache when the user request the same json 3 or 4 time so on. If the browser loads its browser cache json, it will not request the server and JQuery.ajax will not come to success. I add 'cache:false' in jQuery.ajax setting, jQuery.ajax will send your url+random+something to your server. Boost will not send back a cache copy. Any help?
Comments
Comment #1
mikeytown2 commentedWhat does the "random+something" look like?
Comment #2
patrickwang5 commentedBelow is my javascript snip:
dataUrl = "/?q=rssdata/rssdata_json";
$.ajax({
type: "GET",
url: dataUrl,
cache: false,
dataType: "json",
//data: "name=" + encodeURI(name),
success: function( catRssArray ){....} );
I check the firebug, it looks like:
get..... http://www.website.com/rssdata/rssdata_json?_=1272747236876
If I close IE and reopen it, the cache copy will not use.
Comment #3
mikeytown2 commentedI need more details then what you gave me. I'm thinking about "rewriting the query string" to remove the random part. right now it appears the key to the random value is "_", is the correct???
http://wiki.apache.org/httpd/RewriteQueryString
http://www.webmasterworld.com/forum92/3580.htm
Comment #4
patrickwang5 commentedI run it a few times, as below in firebug,
http://www.website.com/rssdata/rssdata_json?_=1272748677913
http://www.website.com/rssdata/rssdata_json?_=1272748775171
http://www.website.com/rssdata/rssdata_json?_=1272748803525
My url location is http://www.website.com/rssdata/rssdata_json, $.ajax will use the above urls to request. thanks.
Comment #5
mikeytown2 commentedSo http://www.kaixinurls.com/rssdata/rssdata_json is the same as http://www.kaixinurls.com/rssdata/rssdata_json?_=1272748677913 correct?
Try adding this to the bottom of your boost rules
And incrementing the skip by 1
RewriteRule .* - [S=8]To this
Comment #6
patrickwang5 commentedIn my cache/normal/.../rssdata folder, each url request will create a boost copy and gzip copy(there will many copies when it grows),
rssdata_json__=1272748677913.json
rssdata_json__=1272748775171.json
rssdata/rssdata_json__=1272748803525.json
rssdata_json__=1272748677913.json.gz
rssdata_json__=1272748775171.json.gz
rssdata/rssdata_json__=1272748803525.json.gz
So each time $.ajax send a request, boost will make a cache copy. what we expect is one rssdata_json cache and it serve all 'rssdata_json?_=num' requests. possible ? :) Because at the beginning, $.ajax will send 'rssdata_json?_=1272748677913' like request, there is no 'rssdata_json' cache copy.
For php, http://www.website.com/rssdata/rssdata_json is the same as http://www.website.com/rssdata/rssdata_json?_=1272748677913. But I don't know for boost cache. I will test around with your last reply boost rules.
Comment #7
mikeytown2 commentedSo I also need to not set the query string when a request comes in from this URL.
Replace this
with this
Comment #8
mikeytown2 commentedComment #9
patrickwang5 commentedGreat.