Regarding the recognition of long service (good conduct was always a given for officers, hence why no award) for commissioned ranks in the REGULAR (ie. full time) branches of the armed forces, this did not occur until 2016, when the respective service medals were extended - along with minor amendments to the requirement criteria.
Officers in the Volunteer Force of the United Kingdom were granted decorations for 20 years' service in 1892 - with the Volunteer Decoration being extended to the Colonial Auxiliary Forces of India and elsewhere two years later.
The regular forces medals are quite straightforward. The numerous issues to the volunteer, auxiliary, militia and reserve formations less so. It's a complex subject... and that's before we even include the naval side of things.