Performance docs - Mention the importance of passing `request` and `current_site` to `get_url`

- Co-authored-by: Andy Babic <ababic@users.noreply.github.com>
pull/9506/head
Jake Howard 2022-10-14 17:15:56 +01:00 zatwierdzone przez LB (Ben Johnston)
rodzic a748497543
commit c6afb0069d
3 zmienionych plików z 10 dodań i 0 usunięć
docs
advanced_topics
releases

Wyświetl plik

@ -11,6 +11,7 @@ Changelog
* Upgrade to Node 18 for frontend build tooling (LB (Ben) Johnston)
* Officially recommend `fnm` over `nvm` in development documentation (LB (Ben) Johnston)
* Test assertion util `WagtailPageTestCase.assertCanCreate` now supports the kwarg `publish=True` to check publish redirection (Harry Percival, Akua Dokua Asiedu)
* Mention the importance of passing `request` and `current_site` to `get_url` on the [performance](performance) documentation page (Jake Howard)
* Fix: Make sure workflow timeline icons are visible in high-contrast mode (Loveth Omokaro)
* Fix: Ensure authentication forms (login, password reset) have a visible border in Windows high-contrast mode (Loveth Omokaro)
* Fix: Ensure visual consistency between buttons and links as buttons in Windows high-contrast mode (Albina Starykova)

Wyświetl plik

@ -58,6 +58,14 @@ Another side benefit is it prevents errors during conversation from causing page
The same can be achieved in Python using [`generate_image_url`](dynamic_image_urls).
### Page URLs
To fully resolve the URL of a page, Wagtail requires information from a few different sources.
The methods used to get the URL of a `Page` such as `Page.get_url` and `Page.get_full_url` optionally accept extra arguments for `request` and `current_site`. Passing these arguments enable much of underlying site-level URL information to be reused for the current request. In situations such as navigation menu generation, plus any links that appear in page content, providing `request` or `current_site` can result in a drastic reduction in the number of cache or database queries your site will generate for a given page load.
When using the [`{% pageurl %}`](page_urls) template tag, the request is automatically passed in, so no further optimisation is needed.
### Search
Wagtail has strong support for [Elasticsearch](https://www.elastic.co) - both in the editor interface and for users of your site - but can fall back to a database search if Elasticsearch isn't present. Elasticsearch is faster and more powerful than the Django ORM for text search, so we recommend installing it or using a hosted service like [Searchly](http://www.searchly.com/).

Wyświetl plik

@ -21,6 +21,7 @@ depth: 1
* Test assertion [`WagtailPageTestCase.assertCanCreate`](testing_reference) now supports the kwarg `publish=True` to check publish redirection (Harry Percival, Akua Dokua Asiedu)
* Upgrade to Node 18 for frontend build tooling (LB (Ben) Johnston)
* Officially recommend `fnm` over `nvm` in development documentation (LB (Ben) Johnston)
* Mention the importance of passing `request` and `current_site` to `get_url` on the [performance](performance) documentation page (Jake Howard)
### Bug fixes