In get_pages(), cache queries to individual cache buckets instead of storing them in one cached array. Also, store post IDs instead of full objects. This reduces overall memory usage as well as the size of the cache buckets. Use incrementor style passive cache invalidation.

Props nprasath002
see #23167


git-svn-id: https://core.svn.wordpress.org/trunk@23300 1a063a9b-81f0-0310-95a4-ce76da25c4cd