machawk1 / tachyon

An experimental Memento browser plugin for Chrome.
1 stars 0 forks source link

Resources in the the local user cache do not go through content negotatiation #29

Closed machawk1 closed 11 years ago

machawk1 commented 11 years ago

This is by design in Chrome. I need some way to prevent the cache from being accessed when in Memento Mode.

machawk1 commented 11 years ago

Potentially call chrome.tabs.reload({reloadProperties: {bypassCache: true}}); to potentially get around this though currently we're just modifying the URI before the request goes out, not reloading the tab.

anjackson commented 11 years ago

To check I understand what's going on: Is the issue that, if a URL has been cached locally (within the browser itself), then the browser does not re-launch a request, i.e. the handler on chrome.webRequest.onBeforeRequest is never called?

anjackson commented 11 years ago

There is also this function, although it is perhaps a little too aggressive:

http://developer.chrome.com/extensions/browsingData.html#method-removeCache

machawk1 commented 11 years ago

removeCache() is a big hammer. Regarding this issue, I've created a MWE that does NOT validate this issue, i.e., cached resource requests still appear to go through the onBeforeRequest handler. For some reason, during the request processing with the Memento logic, some resources requests never hit the handler code.

machawk1 commented 11 years ago

Vs. the MWE, this might be that tachyon is not returning what is expected in the handler, preventing the other resources from hitting the same handlers.

anjackson commented 11 years ago

Can you outline the steps to reproduce this issue? And, what does MWE mean?

machawk1 commented 11 years ago

MWE = Minimum Work Example, a bare bones logic-stripped-out code I used to check which handlers were being called and for what resources. The bare bones MWE Chrome Extension has all resources hitting the handlers regardless of whether they're cached. The tachyon seems to not send requests for the images (for example) through the negotiation process but the initial page resolves correctly.

I am using http://odusource.cs.odu.edu/hello as my basis URL, as it specifies a custom timegate in the HTTP headers. I am activating time travel in the extension by selecting a date then navigating to this page in the browser and watching the log.

hariharshankar commented 11 years ago

Not sure if this has already been tried, but I am able to overcome the caching problem by using the handlerBehaviorChanged() method.

http://developer.chrome.com/extensions/webRequest.html#caching http://developer.chrome.com/extensions/webRequest.html#method-handlerBehaviorChanged