You effectively have two independent problems.
- API version mismatch between client and server
- Accelerating the release of new versions of the code.
API version mismatch
Typically, you'll want to use a versioned API. Each API request should somehow indicate which version the request corresponds to. This is often done in the path of the request, which makes routing to different API servers very easy to do. For example:
http://api.example.com/1.0/foo/bar
Your web server can match on /1.0/ and route to the appropriate application server for your API.
This gives you some flexibility, allowing a rolling release process and not forcing clients to reload every single time you do a release. (You may some day want to release 50 times a day, and your clients won't be too happy about that. No need to force a reload unless you have a specific reason to.)
The easiest way to do this is make new versions of your API backwards compatible as much as possible. But, breaking changes do occur. When this happens, run two instances of your API server simultaneously. If you have a major underlying data structure change, or some other huge change that prevents this, you will need to stop the old versions at the same time as starting the new, and force a reload.
New client code releases
You'll have to decide based on your app and business conditions whether or not it's a requirement to reload each time you have a release. Again, you might some day want 50 releases in a day, most of those for minor issues that most of your customers will never see. It's common to let the user know that a new version is available and let them reload when they feel like it. You can always force a reload if you absolutely have to (due to critical security issue, or major breaking changes).
Implementation
The specifics of how you do this are up to you, but one simple way is to have a basic JSON file available, indicating the latest versions:
{
"apiVersion": "1.0.5"
"appVersion": "1.1.352"
}
More creatively, you could have this file indicate whether or not specific versions need to be killed, and thus a reload forced.