In my current project I'm getting some html templates (for a single page interface web app) via ajax. Now I'm interested if the caching works as expected - so I would like to enable caching for those templates. Does it make sense to enable caching just like on the production environment.
In my opinion I would make no difference between development and production environment.
As I see the pros/cons:
PROS:
CONS:
Does that make sense?
Any other pros / cons / recommendations?
Or is it a better approach to enable caching on the development environment just shortly to test some specific behavior (in my case the caching of the templates, or in another case the caching of the static files)
I think I disagree.
You don't want your client side code cached in dev. Else you are going to spend a lot of time clearing caches, and you are going to spend a lot of time figuring out why things don't work, only for it to be a "oops, I didn't clear my cache" issue.
You do want it cached for your releases. This is easily accomplished via configuration in your build process -- you can append some build specific info to the file names of your build artifacts, and the browser will cache the content for your. When a new release comes, the names of the relevant files are different so the browser will search for them.