Hi all,

Erik Zachte is working on file view stats and is looking for a way to track Media Viewer image views (for which there is no 1:1 relation between server hits and actual image views); after some back and forth inĀ https://phabricator.wikimedia.org/T86914 I proposed the following hack:

whenever the javascript code in MediaViewer determines that an image view happened (e.g. an image has been displayed for a certain amount of time), it makes a request to a certain fake image, say upload.wikimedia.org/wikipedia/commons/thumb/0/00/Virtual-imageview-<real image name>/<size>px-thumbnail.<ext> . These hits can than be easily filtered from the varnish request logs and added to the normal requests. We would add a rule to Vagrant to make sure it does not try to look up such requests in Swift but returns a 404 immediately.

This would be a temporary workaround until there is a proper way to log virtual image views, such as EventLogging with a non-SQL backend.

Do you see any fundamental problem with this?