Capacitor location

3D chip-stacking!

The rule about decoupling close to the supply rail only holds if there is a ground-plane - otherwise it just joins supply and ground close to both pins. An inch or so shouldn't matter, but the shorter (and wider) the leads the more effective (lower stray inductance between chip and its capacitor). The reason PCB traces for power are wider than signal lines is only partly to carry more current, but also to reduce inductance.

A wide PCB trace running opposite a ground-plane = low inductance, a fine wire floating around in mid air away from ground signals = high inductance [typical breadboard!]