mediawiki-extensions-Multim.../tests/qunit/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.test.js Use provider XHR information in performance metrics + several fixes 2014-02-19 00:38:27 +00:00
mmv.provider.FileRepoInfo.test.js Add imageinfo, thumbnail info, repoinfo provider 2014-02-04 23:46:02 +00:00
mmv.provider.GlobalUsage.test.js Renaming things for consistency: DataProvider -> Provider 2014-02-04 23:51:48 +00:00
mmv.provider.Image.test.js Use cross-origin img attribute instead of data URI 2014-02-24 07:56:40 +00:00
mmv.provider.ImageInfo.test.js Refactor panel-related things into another class 2014-02-07 10:09:08 -08:00
mmv.provider.ImageUsage.test.js Renaming things for consistency: DataProvider -> Provider 2014-02-04 23:51:48 +00:00
mmv.provider.ThumbnailInfo.test.js Add Thumbnail model 2014-02-07 01:46:26 +00:00
mmv.provider.UserInfo.test.js Preload prev/next images 2014-02-13 10:52:40 +01:00