I'm still trying to fully wrap my brain around Stash's cacheing system.
From the docs it seems that both :set and :get have the parameters save
, scope
, replace
, and refresh
.
Is there a benefit to using both?
I had thought that perhaps saving on set could be used to store raw data and saving on get could be used to store formatted data. So for example:
{exp:stash:set_list name="products" parse_tags="yes"
save="yes" refresh="60" replace="no" scope="site"}
{exp:low_variables:pair var="lv_products"}
{stash:prod_image}{image}{/stash:prod_image}
{stash:prod_url}{link}{/stash:prod_url}
{stash:prod_title}{link_title}{/stash:prod_title}
{/exp:low_variables:pair}
{/exp:stash:set_list}
And then:
{exp:stash:get_list:nested name="products"
save="yes" refresh="60" replace="no" scope="site"}
{if count == 1}<ul>{/if}
<li><a href="{other_prod_url}">{other_prod_image} <b>{other_prod_title}</b></a></li>
{/if count == total_results}</ul>{/if}
{/exp:stash:get_list:nested}
In a more "real world" example. I have a rather complex drop-down navigation that is built off nav:ee but includes low variables with playa, and matrix to create "mega-dropdowns" I stash each bit of data individually, but then also tried to stash the entire generated menu with the page uri as a context.
Is this a correct/beneficial "layered caching" approach? Or am I missing something here? :)