Add cacheCode to dynamic resource urls
Reset cacheCode when flushing dynamic resources