Why posts and terms are cached
-
I’m was trying to find the keys that are used so I can grab them in another backend through redis, I found these keys after activating your great plugin.
1) "g-wp:post_tag_relationships:146" 2) "g-wp:posts:wp_query-aa16fad670a5ff8ad72056bc80070630-0.58287100 16708342620.57265300 1670834262" 3) "g-wp:site-transient:update_core" 4) "g-wp:site-transient:update_themes" 5) "g-wp:post_tag_relationships:152" 6) "g-wp:terms:6" 7) "g-wp:options:notoptions" 8) "g-wp:terms:3" 9) "g-wp:post_format_relationships:1" 10) "g-wp:redis-cache:metrics" 11) "g-wp:posts:wp_query-c3a917d9566151fdfe5cf29c18b244d3-0.58287100 16708342620.57265300 1670834262" 12) "g-wp:category_relationships:152" 13) "g-wp:comment:get_comments-1b516a23ca8801fb482159bb8e30ecd2-0.90163500 1670834262" 14) "g-wp:comment:get_comments-46612f2dd3b604b784c3eb3dac699d60-0.90163500 1670834262" 15) "g-wp:posts:wp_query-e09d5f678ef68652fefeeed657e70487-0.58287100 1670834262" 16) "g-wp:useremail:[email protected]" 17) "g-wp:terms:get_terms-323b9d928932e9f61a4f7633925cbb88-0.57265300 1670834262" 18) "g-wp:posts:147" 19) "g-wp:options:user_count" 20) "g-wp:userslugs:steve" 21) "g-wp:users:1" 22) "g-wp:terms:2" 23) "g-wp:posts:3" 24) "g-wp:posts:146" 25) "g-wp:post_format_relationships:152" 26) "g-wp:options:alloptions" 27) "g-wp:site-options:1-notoptions" 28) "g-wp:posts:152" 29) "g-wp:comment:get_comments-e96df111ec1dc11a41982d65e4d21821-0.90163500 1670834262" 30) "g-wp:wp_theme_relationships:147" 31) "g-wp:comment:get_comments-bbafb40d4aed04b7b4890f46f3eeac25-0.90163500 1670834262" 32) "g-wp:category_relationships:146" 33) "g-wp:terms:5" 34) "g-wp:comment:get_comments-fbb001ab5aa3f7e15b8511e52af82c41-0.90163500 1670834262" 35) "g-wp:site-transient:update_plugins" 36) "g-wp:post_meta:3" 37) "g-wp:post_meta:1" 38) "g-wp:terms:1" 39) "g-wp:post_meta:147" 40) "g-wp:site-transient:theme_roots" 41) "g-wp:post_meta:146" 42) "g-wp:posts:last_changed" 43) "g-wp:terms:get_terms-ca9d506bdf62bafef81a1d4a61e0d283-0.57265300 1670834262" 44) "g-wp:user_meta:1" 45) "g-wp:options:can_compress_scripts" 46) "g-wp:post_meta:152" 47) "g-wp:posts:1" 48) "g-wp:terms:last_changed" 49) "g-wp:terms:get_terms-f990f9b3b1fb4d541b8d36add5ddfd35-0.57265300 1670834262" 50) "g-wp:comment:last_changed" 51) "g-wp:post_format_relationships:146" 52) "g-wp:post_tag_relationships:1" 53) "g-wp:userlogins:steve" 54) "g-wp:category_relationships:1" 55) "g-wp:default:is_blog_installed"
If I get the value of g-wp:posts:1 for instance I get:
"O:8:\"stdClass\":24:{s:2:\"ID\";i:1;s:11:\"post_author\";i:1;s:9:\"post_date\";s:19:\"2022-10-16 21:36:33\";s:13:\"post_date_gmt\";s:19:\"2022-10-16 21:36:33\";s:12:\"post_content\";s:139:\"<!-- wp:paragraph -->\n<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!OK</p>\n<!-- /wp:paragraph -->\";s:10:\"post_title\";s:12:\"Hello world!\";s:12:\"post_excerpt\";s:0:\"\";s:11:\"post_status\";s:7:\"publish\";s:14:\"comment_status\";s:4:\"open\";s:11:\"ping_status\";s:4:\"open\";s:13:\"post_password\";s:0:\"\";s:9:\"post_name\";s:11:\"hello-world\";s:7:\"to_ping\";s:0:\"\";s:6:\"pinged\";s:0:\"\";s:13:\"post_modified\";s:19:\"2022-11-20 13:27:30\";s:17:\"post_modified_gmt\";s:19:\"2022-11-20 13:27:30\";s:21:\"post_content_filtered\";s:0:\"\";s:11:\"post_parent\";i:0;s:4:\"guid\";s:24:\"https://graphql.test/?p=1\";s:10:\"menu_order\";i:0;s:9:\"post_type\";s:4:\"post\";s:14:\"post_mime_type\";s:0:\"\";s:13:\"comment_count\";i:1;s:6:\"filter\";s:3:\"raw\";}"
Which is the real content of the post! That’s cool but wouldn’t that become too huge for a big website with a lot of posts and pages and custom posts?
I mean then redis would have to use a lot of memory and storage, is this really worth it? a database transaction seems to make more sense doesn’t it?
- The topic ‘Why posts and terms are cached’ is closed to new replies.