When using cache, read file just once, not twice