WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
114517
Webkit reuses cache with different headers
https://bugs.webkit.org/show_bug.cgi?id=114517
Summary
Webkit reuses cache with different headers
Omar Ajoue
Reported
2013-04-12 10:41:44 PDT
In order to reproduce this bug you should follow the following steps: 1) browse the following url:
http://br.kekanto.com/search?&c=269853&m=c&lat=-23.548547000&lng=-46.638272000&q=pizza&near=S%C3%A3o+Paulo
It shows a list of places selling pizza in Sao Paulo. 2) Click either the star rating filter or price range (star and dolar signs respectively; NOTE: these are anchor tags <a>). The pages reloads using AJAX and the new results are shown. I use pushState to create a new URL entry. 3) Navigate away from the page (like clicking a place name) 4) Press the back button The expected result should be the same listing as before, but the actual result is a JSON. Problem is: The URL pushed in the pushState is the same as Web Service used to populate the page. The browser considers it has a copy of the page and serves it, but that is a JSON. The same URL, if requested with the X-Requested-With: XMLHTTPRequest brings a JSON instead. NOTE: If you click a checkbox in the page it triggers the EXACT same reload function, but this does not cause the problem. Only happens only when browsing using anchor tags that change the underlying form and trigger a submit via AJAX.
Attachments
Add attachment
proposed patch, testcase, etc.
Brady Eidson
Comment 1
2013-04-16 09:27:44 PDT
If I understand this report correctly, you're saying that you wished WebKit would not look up a request to this URL in its cache if the value of the X-Requested-With header differs? If so, try making your server reply to requests for this URL respond with "Vary: X-Requested-With".
Omar Ajoue
Comment 2
2013-04-16 10:21:30 PDT
Thanks a lot Brady for your answer, this really solved the problem - I tried adding the response header Content-type: application/json but it still kept showing the JSON file instead of a page. Now with the Vary header everything works as expected.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug