Can Varnish/Nginx cache and store PHP pages after user visited?

view full story

http://serverfault.com – Please assume that there is a PHP CMS that retrieves content according to IDs from database. So every time you visit this website it interacts with Database and Processes the PHP request. Now my question is: Can Nginx or Varnish cache and store a page after user visited that page? so next time if any user visits that page it would load faster. (HowTos)