Page MenuHomePhabricator

ResourceLoader debug urls should bypass cache when they change
Closed, ResolvedPublic

Description

http://bits.beta.wmflabs.org/static-master/extensions/VisualEditor/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css

This file looks nothing like this on master. For posterity:

/*!
 * VisualEditor MediaWiki Initialization ViewPageTarget styles.
 *
 * @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
 * @license The MIT License (MIT); see LICENSE.txt
 */

/* VisualEditor */

.ve-init-mw-viewPageTarget-transform {
	-webkit-transition: opacity 200ms ease-out;
	-moz-transition: opacity 200ms ease-out;
	-o-transition: opacity 200ms ease-out;
	transition: opacity 200ms ease-out;
}

.ve-init-mw-viewPageTarget-transform-muted {
	opacity: 0.6;
}

.ve-init-mw-viewPageTarget-pageTitle {
	cursor: default;
}

/* Toolbar */

.ve-init-mw-viewPageTarget-toolbar-utilities,
.ve-init-mw-viewPageTarget-toolbar-actions {
	display: inline-block;
	vertical-align: middle;
}

.ve-init-mw-viewPageTarget-toolbar-actions {
	font-size: 0.8em;
	vertical-align: top;
	padding: 0.25em;
}

.ve-init-mw-viewPageTarget-toolbar-utilities > .oo-ui-buttonElement-frameless {
	margin-right: 0.2em;
	margin-top: 0.2em;
}

.ve-init-mw-viewPageTarget-toolbar-actions > .oo-ui-buttonElement-framed {
	margin-left: 0.25em;
	margin-right: 0.25em;
	margin-top: 0.2em;
}

/* Needs to override .oo-ui.widget.oo-ui-widget-disabled */
.ve-init-mw-viewPageTarget-waiting.oo-ui-widget.oo-ui-widget-disabled {
	cursor: progress;
}

Isn't beta supposed to be updated continuously?

Event Timeline

matmarex raised the priority of this task from to High.
matmarex updated the task description. (Show Details)
matmarex subscribed.

For the given url http://bits.beta.wmflabs.org/static-master/extensions/VisualEditor/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css

HTP 200
Accept-Ranges:bytes
Access-Control-Allow-Origin:*
Age:2519771
Cache-Control:max-age=2592000
Connection:keep-alive
Content-Length:1232
Content-Type:text/css
Date:Fri, 27 Feb 2015 01:17:46 GMT
ETag:"4d0-50c8b3e7e3800"
Expires:Fri, 27 Feb 2015 21:21:35 GMT
Last-Modified:Tue, 13 Jan 2015 16:37:52 GMT
Server:Apache
Via:1.1 varnish
X-Cache:deployment-cache-bits01 hit (44)
X-Powered-By:HHVM/3.3.0-static
X-Varnish:1048698637 1047370037
HTTP 304
Accept-Ranges:bytes
Access-Control-Allow-Origin:*
Age:2519800
Cache-Control:max-age=2592000
Connection:keep-alive
Content-Type:text/css
Date:Fri, 27 Feb 2015 01:18:15 GMT
ETag:"4d0-50c8b3e7e3800"
Expires:Fri, 27 Feb 2015 21:21:35 GMT
Last-Modified:Tue, 13 Jan 2015 16:37:52 GMT
Server:Apache
Via:1.1 varnish
X-Cache:deployment-cache-bits01 hit (48)
X-Powered-By:HHVM/3.3.0-static
X-Varnish:1048698641 1047370037

When adding a cache-buster query parameter to this url, it returns the latest version properly.

Krinkle renamed this task from Beta labs are serving three-weeks-old content to Beta labs bits should not cache static-master for three weeks.Feb 27 2015, 1:20 AM
Krinkle set Security to None.
greg renamed this task from Beta labs bits should not cache static-master for three weeks to Beta cluster bits should not cache static-master for three weeks.Feb 27 2015, 4:46 AM
greg lowered the priority of this task from High to Medium.Mar 2 2015, 5:21 PM
greg moved this task from To Triage to Next: Maintenance on the Beta-Cluster-Infrastructure board.

I keep getting stale versions of gadget js, even after clearing local storage.

For http://wikidata.beta.wmflabs.org/wiki/Q12480, I am getting old ext.gadget.AuthorityControl

with debug=true, it works (obviously) to get new javascript and subsequently (assume it is cached in local storage) the gadget works correctly.

We have browser tests for this gadget and it's frustrating that even after updating the gadget to work again with master, the tests fail unless we add "debug=true" or such hacks.

even though the gadget was modified today, the response has "Last-Modified:Thu, 26 Feb 2015 18:21:11 GMT" for:

http://bits.beta.wmflabs.org/wikidata.beta.wmflabs.org/load.php?debug=false&lang=en&modules=ext.PropertySuggester.EntitySelector%7Cext.eventLogging%2CnavigationTiming%7Cext.eventLogging.subscriber%7Cext.gadget.AuthorityControl%2CSiteIdToInterwiki%7Cext.imageMetrics.loader%7Cext.uls.eventlogger%2Cpt%7Cext.wikimediaEvents.statsd%7Cjquery.checkboxShiftClick%2CgetAttrs%2ChighlightText%2CmakeCollapsible%2Cmw-jump%2Cplaceholder%2Csuggestions%7Cmediawiki.action.view.postEdit%7Cmediawiki.cookie%2CsearchSuggest%2Ctemplate%7Cmediawiki.page.ready%7Cschema.NavigationTiming%2CSaveTiming%2CUniversalLanguageSelector&skin=vector&version=20150629T182457Z&*

Accept-Ranges:bytes
Age:343901
Cache-control:public, max-age=2592000, s-maxage=2592000
Connection:keep-alive
Content-Encoding:gzip
Content-Length:19218
Content-Type:text/javascript; charset=utf-8
Date:Mon, 02 Mar 2015 17:52:52 GMT
Expires:Sat, 28 Mar 2015 18:21:11 GMT
Last-Modified:Thu, 26 Feb 2015 18:21:11 GMT
Server:Apache
Vary:Accept-Encoding
Via:1.1 varnish
X-Cache:deployment-cache-bits01 hit (4)
X-Content-Type-Options:nosniff
X-Powered-By:HHVM/3.3.1
X-Varnish:1048847910 1048678134

I have merged this task with T65034: Caching makes it impossible to test JS changes when logged out. I have no idea how we handle the bits cache invalidation on production, I thought it had an expiry of 5 minutes with revalidation against the backend, but that is apparently not the case.

Krinkle reopened this task as Open.EditedJun 16 2015, 1:33 AM
Krinkle subscribed.

I have merged this task with T65034: Caching makes it impossible to test JS changes when logged out. I have no idea how we handle the bits cache invalidation on production, I thought it had an expiry of 5 minutes with revalidation against the backend, but that is apparently not the case.

Unmerged. This is a separate issue and very specific. I've declined T65034.

For now its presumed that this issue us specific to Beta labs' configuration. It should indeed have an expiry of 5 minutes for unversioned content.

However, it may turn out to be a duplicate of T99096 if it's only about the static-master directories (since beta's version is "master").

This is still the case and still just as frustrating. I forgot that it's been fucked up for months today and tried to test code on beta again.

Change 270443 had a related patch set uploaded (by Krinkle):
resourceloader: Add content hash to static debug urls

https://gerrit.wikimedia.org/r/270443

After T99096, caching these urls for 3 weeks is fine. In fact, it'll be 30 days. Beta Cluster having a special continuous version of "master" is no longer an issue as the new infrastructure will assign a low cache max-age to unversioned resources.

In addition, ResourceLoader debug mode will now actually add content hashes to these urls, so that changes apply regardless of caching - and when there are no changes they fully benefit caching.

Krinkle renamed this task from Beta cluster bits should not cache static-master for three weeks to ResourceLoader debug urls should bypass cache when they change.Feb 12 2016, 11:58 PM

Change 270443 merged by jenkins-bot:
resourceloader: Add content hash to static debug urls

https://gerrit.wikimedia.org/r/270443

This change has a side effect for developers using Chrome dev tools workspace feature. The hash value as querystring in resource URL will cause Chrome dev tool not to map it with workspace. This is a bug in Chrome dev tool https://bugs.chromium.org/p/chromium/issues/detail?id=277885

Happen to notice this - and it turns out that a few few months after we reported this, Chromium released a reimagined version of their "Workspace" feature which claims to solve for this.

DevTools: enable persistence2.0 experiment by default

This patch enables persistence2.0 experiment by default, which results
in the following changes:

  • automapping will be enabled by default for all workspace users (Automapping Design Doc)
  • a new UI for workspaces will be enabled by default for all workspace users

The document in question calls out lack of tolerance for cache-busting query strings as one of the main flaws in their "old" approach.