return $r; } /** * @param int $page 页数 * @param int $pagesize 每页显示数量 * @return mixed */ function link_find($page = 1, $pagesize = 100) { $arr = link__find($cond = array(), array('rank' => -1), $page, $pagesize); return $arr; } /** * @param $id * @return bool 返回FALSE失败 TRUE成功 */ function link_delete($id) { if (empty($id)) return FALSE; $r = link__delete(array('id' => $id)); link_delete_cache(); return $r; } //--------------------------kv + cache-------------------------- /** * @return mixed 返回全部友情链接 */ function link_get($page = 1, $pagesize = 100) { $g_link = website_get('friends_link'); if (empty($g_link)) { $g_link = link_find($page, $pagesize); $g_link AND website_set('friends_link', $g_link); } return $g_link; } // delete kv and cache function link_delete_cache() { website_set('friends_link', ''); return TRUE; } ?>performance - Are pages consuming more server resources than posts?
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

performance - Are pages consuming more server resources than posts?

programmeradmin1浏览0评论

Is there any performance difference between the way wordpress handle pages and posts when i'm querying for them ?

In the same way, is there any performance difference between hierarchical custom post types (that are behaving like pages) and non hierarchical custom post types (that are behaving like posts) when i'm querying for them ?

The context of this question is : as i'm building a multilingual website and as custom taxonomies slug aren't translatable (in a multilingual context), i was about to simply use native pages (whose slug are translatable) in order to build a parent-page/child-page relationship instead of using custom taxonomies.

Is there any performance difference between the way wordpress handle pages and posts when i'm querying for them ?

In the same way, is there any performance difference between hierarchical custom post types (that are behaving like pages) and non hierarchical custom post types (that are behaving like posts) when i'm querying for them ?

The context of this question is : as i'm building a multilingual website and as custom taxonomies slug aren't translatable (in a multilingual context), i was about to simply use native pages (whose slug are translatable) in order to build a parent-page/child-page relationship instead of using custom taxonomies.

Share Improve this question edited Nov 21, 2019 at 23:24 PhpDoe asked Nov 21, 2019 at 21:14 PhpDoePhpDoe 2992 silver badges11 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Pages and posts are identical in performance at first, as they are loaded from the same table: wp_posts. However if the theme is including in the render for the page widgets or meta or taxonomies, they could vary greatly on performance, but a priori can't be affirmed one or other is more performant.

It is really a matter of the render and assets that your theme is including. For example a post could be very fast to load and other post in the same could load tons of resources. Same thing for pages. They are basically the same by themselves.

发布评论

评论列表(0)

  1. 暂无评论