do not serialize if cache is disabled (performance improvement)