Question:
If I write a block of code in masterPage.js, will caching be disabled for every single page on my site?
Additional Information
I wrote a block of code into masterPage.js to restrict access to certain pages, specifically the Wix Stores Checkout page, which cannot be accessed via Page settings and consequently restricted to member’s access only.
I read in this article that if there is “Velo code running site-wide, caching is disabled for all pages”. I assume this means that if a page has “automatic caching” but has at least a single line of Velo code, “automatic caching” would mean caching is automatically disabled in lieu of code possibly changing data available to the page".
However, the article doesn’t specify what “Velo code running site-wide” entails. Personally, I interpreted this as:
Since Velo mentioned that you put code in masterPage.js to run site-wide, but doesn’t reference masterPage.js when mentioning Velo code here, this might mean that there are other cases where code can run site-wide!
and hence, my confusion.
“Site-wide Velo code” definitely can’t refer to individual page code, those should only disable caching for their respective page. So would this refer specifically to code in masterPage.js? And what are the rules regarding this since masterPage.js already has the $w.onReady listener, does that count?
But could this also refer to back-end code in events.js or data.js? Since they technically can run from any part of the site as long as the appropriate hooks are triggered.
TLDR: I want to know specifically when automatic caching is disabled so that I can better understand the consequences of using Velo code and what I would have to account for afterwards, e.g. enabling manual caching for static pages.