But the server knows which frame you pressed the 'w' on. So when it gets the 'w', it rewinds it's state machine X frames (hopefully X==1), applies your input, moves the state machine forward X+1 frames and displays that state.
So there might be a slight visual glitch but you won't be missing your targets.