Skip to content

Commit 2a1cc91

Browse files
committed
Merge pull request #70 from e-sites/master
Updated docs with urlArgs functionality
2 parents 3842517 + a40abf6 commit 2a1cc91

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,16 @@ $script.get('http://example.com/base.js', function () {
149149
})
150150
```
151151

152+
### $script.urlArgs()
153+
As of 2.5.5 it's possible to concat URL arguments (i.e. a query string) to the script path.
154+
This is especially useful when you're in need of a cachebuster and works as follows:
155+
156+
```js
157+
$script.urlArgs('key=value&foo=bar');
158+
```
159+
160+
Please note that Squid, a popular proxy, doesn’t cache resources with a querystring. This hurts performance when multiple users behind a proxy cache request the same file – rather than using the cached version everybody would have to send a request to the origin server. So ideally, [as Steve Souders points out](http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/), you should rev the filename itself.
161+
152162
### Developers
153163

154164
Building a $script environment works like this:

0 commit comments

Comments
 (0)