Use potting compound to secure solder joint
I was wondering whether I should protect the solder joints, as the cables may shift over time (and tension).


This is a PCB-mount switch.  Its contacts aren't intended for soldering discrete wires directly to them.  If you actually wan to achieve long term robustness, you should make a small PCB with: a footprint for the switch, a wire-to-board connector of your choice, and maybe mounting holes too. 

Such is the proper solution to your technical issue.