The following call is proving problematic from a page load perspective:
{exp:channel:entries channel="channel" limit="1000" disable="categories|member_data|trackbacks|pagination" search:product_year="2004|2005|2006|2007|2008" dynamic="yes"}
Firstly, I call this in a simple if conditional based on url_segments so it should be parsed early but the use of else means it is advanced and not simple in EE speak.
{if segment_2 == ""}
{if:elseif segment_4 == "archive"}
***the code***
{if:else}
{/if}
I cannot disable custom_fields as I need to search them as shown.
Bug debugging the template shows that 5 of the 6 seconds it takes this page to load is repeated calls by Matrix to grab this data.
(0.418034 / 43.67MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
etc etc
Annoying it only happens on the template_group/index/ page as the category indexes are limited to just the number of entries for that category and not the site total (approx. 4000). Essentially all the matrix data is loaded for all entries on the index page even though I am only outputting categories.
Anyway I can disable specific custom fields or only make these data calls where it is required? I tried using an embed for the code, but according to the debug the matrix calls are still made.
UPDATE:
Managed to solve this - tried the embedded templates again and it worked this time.