Opened 17 years ago
Closed 16 years ago
#11373 closed enhancement (fixed)
get_page_by_path() enhancements
| Reported by: | Denis-de-Bernardy | Owned by: | ryan |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1 |
| Component: | Cache API | Version: | 2.9 |
| Severity: | normal | Keywords: | early has-patch commit gsoc |
| Cc: | Focuses: |
Description
The attached file works around a few queries in get_page_by_path() when memcached is used on a site, by trying to fetch page parents in the object cache before fetching the needed data in the database.
Attachments (2)
Change History (15)
#3
follow-ups:
↓ 4
↓ 6
@
17 years ago
Is there any good reason why get_page() or get_post() couldnt be used inside that loop to take care of the query & caching?
#4
in reply to: ↑ 3
@
17 years ago
- Keywords commit added
- Milestone Future Release → 3.0
Replying to dd32:
Is there any good reason why get_page() or get_post() couldnt be used inside that loop to take care of the query & caching?
Depends if you want to do a SELECT * or not... This one can safely get checked in, I've been using it on my own site for months.
#6
in reply to: ↑ 3
@
16 years ago
- Cc added
Replying to dd32:
Is there any good reason why get_page() or get_post() couldnt be used inside that loop to take care of the query & caching?
get_page() is used below, when desired page is found. While it's not found, database is queried inside 2 TWO loops over and over again searching for the desired page. And when that's the case, all we need is post_parent, post_name and ID.
If that post is in cache, there's no need to query database, just get it from cache and move on. Faster and secure. I vote for this patch to be commited :)
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #11292 and #10381.