Generally this technique is used with mostly static content.
You have your script return headers that tell the browser to cache for a long time - this lowers bandwidth because the browser will use the cached copy, instead of requesting a new one. Great for things like javascript libraries, logos, CSS files, etc.
The downside is that when you do change things, people won't see them because they've been cached. This can be even worse when you have inter dependencies - such as a new javascript widget library, that depends on a new version of your CSS file or another javascript file. If only one gets loaded, the page may not look/work properly.
One semi-solution to this is to set the expiry to a balanced time, eg a day, so that everyone will eventually request new content (at the expense of slightly increased bandwidth due to grabbing the content at least once a day). However, this doesn't solve dependency issues.
Using a random parameter (?cache=) is a great solution to this problem. Basically, the server ignores the parameter, but for the browser, different parameters means different URL. Your main site can know when the content changes, and thus change the parameter value, forcing the browser to refresh, at the instant it changes (there is no possibility for stale caches or dependency problems, assuming your code is okay).
The parameter name doesn't matter, nor does its value -- obviously you want to avoid something that will be interpreted by the server though. Popular choices for this mechansim:
* md5 of the file (cache this server-side as well, as it can be expensive to calculate)
* date/time of the file, or hash of the date/time
* version number of the file or overall site (if you increment a version every time you deploy any new content)
Theres a blog post up about how they do caching on stackoverflow.
One other scenario I've seen is deploying to a server that by default sent headers that caused the content to cache, for example, some hosting providers used to do this (probably still do, but I haven't seen the problem personally in a decade). By setting ?cache= you can get around this. The real solution here though is to make your server not cache by default if that doesn't make sense for your use.