Commit graph

7 commits

Author SHA1 Message Date
Gergő Tisza 284a936aff Cache API responses
Cache API responses, both on Varnish and in the user's browser.
The imageinfo request is not cached, since that would make it very
hard to test metadata template edits. Everything else is cached for
one day.

Change-Id: I9149cf40d4448a424073eefd1eb442c70c977687
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/435
2014-04-22 10:56:52 +02:00
Gergő Tisza ead038c34f Add rejection logging to providers
Make sure it is easy to debug when one of the promises rejects (and
causes the whole promise chain to fail).

I'm not really happy with this, but still seemed better than adding
the same boilerplate error logging code to each provider one-by-one.

Change-Id: Idd2b638f012ef2ff250e350e2f6a60bb8b81899b
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/268
2014-03-03 21:35:01 +00:00
Mark Holmquist 1733df8dc9 Grand Unified Documentation Patch Jr.
The GRUDP is dead, long live the GRUDPJ

Change-Id: I71a22c3aa42b2eb799ce8104159e8c7e56fe13ae
2014-02-21 00:55:43 +00:00
Gergő Tisza 7afbc5ce92 Use provider XHR information in performance metrics + several fixes
* more robust method of obtaining URL
* decouple performance logging from providers (mostly)
* ignore fake XHR object which jQuery returns for JSONP requests
* guard for CORS requests - apparently Chrome refuses to return
  certain information even with an Allow-Origin: * response header.
* Resource Timing is limited to 150 results, which causes fake
  misses in debug mode. There is an API to increase the limit
  but it is not implemented in Chrome. I am calling it nevertheless,
  maybe IE understands it (it is present in the MSDN docs at least).

This seems to work for AJAX, CORS, JSONP, image AJAX; CORS requests
return 0 for a lot of values, per spec a Timing-Allow-Origin: *
header might help that.

Change-Id: I8353858022f51a7e70774e65513d0fa2554a5064
2014-02-19 00:38:27 +00:00
Gilles Dubuc e74fc33e89 Track detailed content loading network performance
Leverages the W3C Navigation Timing API when available

Change-Id: Ief1d327d1bd8928bf5f2bf0bd4c7141a0a608a53
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/126
2014-02-07 19:37:22 +00:00
Gergő Tisza 85a37d0e14 Add imageinfo, thumbnail info, repoinfo provider
Change-Id: I80ffec39ee6c9e0ea0b37be2fc48315063b5ff8a
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/123
2014-02-04 23:46:02 +00:00
Gergő Tisza e0edec21b2 Move providers into their own subdirectory
Also refactor MultimediaViewer.php a bit to get rid of all the globals.

Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/123
Change-Id: Ieca4263ecc7652dc6bc36db63b99d3813c4653e4
2014-02-01 03:49:30 +00:00