I recently deployed my Magento site and started using Varnish on it.
However, we do have some PHP logic that place an open and close button on each of the stores (they are open on working times), and after it`s closed it should received any orders. Also, we have logics on the buttons 'Add to Cart', to inform the customer when the store is opened.
The issue here is that if I serve the pages with VArnish, the loading time indeed is marvelous, however when the store gets opened (or closed), the page is not refreshed (of course).
Which would be a best practice in this case?
- Write an AJAX logic to obtain these dynamic information from the backend
- Run Varnish Purge for all pages that have this logic, by the time the store is opened
- Have a low TTL set (this will reduce Cache Hit).
Thank you very much for the help.
Best Regards, Mauricio.