Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8805673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:55:37+00:00 2026-06-14T01:55:37+00:00

I recently deployed my Magento site and started using Varnish on it. However, we

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:55:39+00:00Added an answer on June 14, 2026 at 1:55 am

    What about storing the open and close times of each store in the html and use javascript to show the current status to the user? That way you can use the cache and still have the dynamic parts that you mentioned.

    Example (will not work, mostly pseudo code):

    <p id="open" data-open-start="8:00 UTC" data-open-end="16:00 UTC">We are open between 8:00 UTC and 16:00 UTC</p>
    
    <script>
      // assuming JQuery
      var open_start_time = [get data-open-start-time and parse it]
      var open_end_time = [get data-open-end-time and parse it]
      // some time zone conversions...
      if (currentTime >= open_start_time && currentTime <= open_end_time) {
        $('p#open').text('we are open!');
      } else {
        $('p#open').text('sorry, we are closed!');
      }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently started work on an application that is already deployed to production.
I've recently deployed some A/B testing experiments using vanity to my heroku instance. However,
I recently read that php applications can be deployed on Google App Engine using
I recently deployed a site http://boardlite.com . One of the tester websites http://www.gidnetwork.com/tools/gzip-test.php suggests
I have a Ruby on Rails app that I've recently deployed to a remote
I recently bought some webspace with dailyrazor.com. I have deployed an application I have
I have a Titanium Android app that I'm developing and recently deployed to the
Currently I am creating VBA Macros for Excel and recently have started using UserForms.
I have an issue with a new sharepoint install that we've recently deployed to
I have recently installed .net 3.5 SP1. When I deployed a compiled web site

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.