Skip to content

Commit

Permalink
Do not ask for systempage everytime we load the page definition
Browse files Browse the repository at this point in the history
While rendering the sitemap we ask for the page definition.

Previously we immediately returned an empty hash if the page is a `systempage?`.
That causes two extra queries for each page we render.

Instead we do not ask for `systempage?` anymore, because if the page definition
can't be found we already return an emtpy hash.

This speeds up rendering large sitemaps by about 6 times.
  • Loading branch information
tvdeyen committed Aug 11, 2017
1 parent 41acc37 commit 5a4c0d3
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion app/models/alchemy/page/page_natures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def status_title(status_type)

# Returns the self#page_layout definition from config/alchemy/page_layouts.yml file.
def definition
return {} if systempage?
definition = PageLayout.get(page_layout)
if definition.nil?
log_warning "Page definition for `#{page_layout}` not found. Please check `page_layouts.yml` file."
Expand Down

0 comments on commit 5a4c0d3

Please sign in to comment.