Requesting: a good reference for formal manipulation of limits of diagrams, with respect to maps of index diagrams.

As an example, consider the following result, for some "nice enough" category C (say, Top), there is a natural isomorphism $$(A \times_B C) \times_C D \cong A \times_B D.$$ This is a nice, intuitively true result that if we stick two pullback squares next to each other, we get another pullback square. I can easily convince myself of this on paper, chasing around the requisite number of arrows -- and it's a simple enough result that no wizardry is required; all maps could be named and the necessary commutativity relations and existence/uniqueness conditions can be checked.

However, it's a bit unsatisfactory. There's a blow-up of notation required to prove a relatively simple result. What happens when the diagrams get more complicated? It becomes less clear how proving basic results about limits can be written up with an acceptable amount of rigor, while remaining concise.

A general question of this type: let $C$ be a complete category, and let $D,E$ be small categories. A functor $f : D \to E$ induces a functor $f^* : C^E \to C^D$. For which $f$ is it the case that $\lim_E = \lim_D \circ f^*$ as functors $C^E \to C$?

It is at least intuitively clear that if $f(D)$ sufficiently "sits above" $E$, then this will hold. I am interested in formalizing this intuition.

I'm sure this question must have a standard answer in category theory, but a sufficient reference escapes me at the moment.