  A practical barrier to the implementation of cache-aided networks is dynamic
and unpredictable user behavior. In dynamic setups, users can freely depart and
enter the network at any moment. The shared caching concept has the potential
to handle this issue by assigning $K$ users to $P$ caching profiles, where all
$\eta_{p}$ users assigned to profile $p$ store the same cache content defined
by that profile. The existing schemes, however, cannot be applied in general
and are not dynamic in the true sense as they put constraints on the
transmitter-side spatial multiplexing gain $\alpha$. Specifically, they work
only if $\alpha \leq \min_{p} \eta_{p}$ or $\alpha \geq \hat{\eta}$, where in
the latter case, $\gamma$ is the normalized cache size of each user,
$\hat{\eta}$ is an arbitrary parameter satisfying $1 \leq \hat{\eta} \leq
\max_{p} \eta_{p}$, and the extra condition of $\alpha \geq K\gamma$ should
also be met. In this work, we propose a universal caching scheme based on the
same shared-cache model that can be applied to any dynamic setup, extending the
working region of existing schemes to networks with $\min_{p} \eta_{p} \leq
\alpha \leq \hat{\eta}$ and removing any other constraints of existing schemes.
We also derive the closed-form expressions for the achievable
degrees-of-freedom (DoF) of the proposed scheme and show that it achieves the
optimal DoF for uniform user distributions. Notably, it is the first scheme to
achieve the optimal DoF of $K\gamma+\alpha$ for networks with uniform user
distribution, $\alpha > \hat{\eta}$, and non-integer
$\frac{\alpha}{\hat{\eta}}$, without imposing any other constraints. Finally,
we use numerical simulations to assess how non-uniform user distribution
impacts the DoF performance and illustrate that the proposed scheme provides a
noticeable improvement over unicasting for uneven distributions.
