source code for difference cache