These types of requests can be cached for a short time (~5 min) in
Squid/Varnish.
Change importScript to be consistent with importStylesheet in the query
parameter order (title, action, ctype).
We only send purges for the exact urls as used by importScript and
importStylesheet.
Note: ResourceLoader things have their cache handled separately and
aren't affected by this change.
Users like instant updating of scripts after having changed them.
Bug: 56874
Change-Id: Idaa8552cf371dbafeb8b730f35b3b5c4fc339fb0
}
}
+ // If we are looking at a css/js user subpage, purge the action=raw.
+ if ( $this->isJsSubpage() ) {
+ $urls[] = $this->getInternalUrl( 'action=raw&ctype=text/javascript' );
+ } elseif ( $this->isCssSubpage() ) {
+ $urls[] = $this->getInternalUrl( 'action=raw&ctype=text/css' );
+ }
+
wfRunHooks( 'TitleSquidURLs', array( $this, &$urls ) );
return $urls;
}
$contentType = $this->getContentType();
- # Force caching for CSS and JS raw content, default: 5 minutes
+ # Force caching for CSS and JS raw content, default: 5 minutes.
+ # Note: If using a canonical url for userpage css/js, we send an HTCP purge.
if ( $smaxage === null ) {
if ( $contentType == 'text/css' || $contentType == 'text/javascript' ) {
$smaxage = intval( $wgForcedRawSMaxage );
return s;
};
-win.importStylesheet = function( page ) {
- return win.importStylesheetURI( mw.config.get( 'wgScript' ) + '?action=raw&ctype=text/css&title=' + mw.util.wikiUrlencode( page ) );
+win.importStylesheet = function ( page ) {
+ var uri = mw.config.get( 'wgScript' ) + '?title=' +
+ mw.util.wikiUrlencode( page ) +
+ '&action=raw&ctype=text/css';
+ return win.importStylesheetURI( uri );
};
win.importStylesheetURI = function( url, media ) {