use swap! to avoid loosing cache updates
Merge pull request #1 from nicolas-ginder/master

use swap! to avoid losing cache updates when accessed in parallel.