  We consider a cache updating system with a source, a cache with limited
storage capacity and a user. There are $n$ files. The source keeps the freshest
versions of the files which are updated with known rates. The cache gets fresh
files from the source, but it can only store the latest downloaded versions of
$K$ files where $K\leq n$. The user gets the files either from the cache or
from the source. If the user gets the files from the cache, the received files
might be outdated depending on the file status at the source. If the user gets
the files directly from the source, then the received files are always fresh,
but the extra transmission times between the source and the user decreases the
freshness at the user. Thus, we study the trade-off between storing the files
at the cache and directly obtaining the files from the source at the expense of
additional transmission times. We find analytical expressions for the average
freshness of the files at the user for both of these scenarios. Then, we find
the optimal caching status for each file (i.e., whether to store the file at
the cache or not) and the corresponding file update rates at the cache to
maximize the overall freshness at the user. We observe that when the total
update rate of the cache is high, caching files improves the freshness at the
user. However, when the total update rate of the cache is low, the optimal
policy for the user is to obtain the frequently changing files and the files
that have relatively small transmission times directly from the source.
