mediawiki-extensions-Multim.../resources/mmv/provider
Gilles Dubuc 28b8f5095e Use cross-origin img attribute instead of data URI
After lots of experimenting with Wireshark and
current Chrome + Firefox on Ubuntu 13.10, this is my
current understanding of the caching when preloading images
with AJAX requests:

* on Chrome, the image request always comes from browser cache
* Firefox makes two separate requests by default
* Firefox with img.crossOrigin = 'anonymous' makes two separate
  requests, but the second one is a 304 (does not load the
  image twice)
* when the image has already been cached by the browser (but not in
  this session), Chrome skips both requests; Firefox skips the AJAX
  request, but sends the normal one, and it returns with 304.

"wish I knew this when I started" things:
* the Chrome DevTools has an option to disable cache. When this is
  enabled, requests in the same document context still come from
  cache (so if I load the page, fire an AJAX request, then without
  reloading the page, fire an AJAX request to the same URL, then the
  second request will be cached), but an AJAX request - image request
  pair is an exception from this.
* when using Ctrl-F5 in Firefox, requests on that page will never hit
  the cache (even AJAX request fired after user activity; even if
  two identical requests follow each other). When using clear cache
  + normal reload, this is not the case.
* if the image does not have an Allow-Origin header and is loaded
  with crossOrigin=true, Firefox will refuse to load it. Chrome will
  log an error in the console saying it refused to load it, but will
  actually load it.
* Wireshark rocks.

Pushed some tech debt (browser + domain whitelist) into other tickets:
https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/232
https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/233

Reverted commits:
    8a8d74f01d.
    63021d0b0e.

Change-Id: I84ab2f3ac0a9706926adf7fe8726ecd9e9f843e0
Bug: 61542
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/207
2014-02-24 07:56:40 +00:00
..
mmv.provider.Api.js Grand Unified Documentation Patch Jr. 2014-02-21 00:55:43 +00:00
mmv.provider.FileRepoInfo.js Grand Unified Documentation Patch Jr. 2014-02-21 00:55:43 +00:00
mmv.provider.GlobalUsage.js Grand Unified Documentation Patch Jr. 2014-02-21 00:55:43 +00:00
mmv.provider.Image.js Use cross-origin img attribute instead of data URI 2014-02-24 07:56:40 +00:00
mmv.provider.ImageInfo.js Grand Unified Documentation Patch Jr. 2014-02-21 00:55:43 +00:00
mmv.provider.ImageUsage.js Grand Unified Documentation Patch Jr. 2014-02-21 00:55:43 +00:00
mmv.provider.ThumbnailInfo.js Grand Unified Documentation Patch Jr. 2014-02-21 00:55:43 +00:00
mmv.provider.UserInfo.js Grand Unified Documentation Patch Jr. 2014-02-21 00:55:43 +00:00