LKW Posted September 8, 2022 Share Posted September 8, 2022 (edited) Site URL: https://www.whitprint.com/emprex-22-inv 7.0/Montauk We have a product page whose prices are updated every morning (which we do by importing inventory from a .csv file). Our shoppers visit the page every day. A couple of shoppers have told us that when they open the page in their browser they see yesterday's prices until they refresh the page after it has loaded. One shoppers asserts that this happened even though he'd closed the page the previous day. This sounds to me like browsers are fetching day-old content from cache. Is this what's happening? More importantly, is there anything we can do on our site to prevent browsers from fetching cached content when reopening this page? We could have our page display "Refresh for current prices!" but that seems lame. Also, we didn't get any complaints about stale prices in previous years. (This is the third year we've run this product campaign.) Maybe this year's shoppers are just fussier, or maybe ... something has changed in Squarespace? ps: Wow, you hit Return at the wrong time and suddenly you've already posted your question! Anyway, I just wanted to add that I first posted this in Commerce but it occurs to me that maybe there's some coding that would solve this problem. If I don't get any suggestions soon I'm going to have to add the "Refresh for current prices!" to our page. ☹️ Edited September 8, 2022 by LKW Hit return too soon! Link to comment
creedon Posted September 8, 2022 Share Posted September 8, 2022 Quote This sounds to me like browsers are fetching day-old content from cache. Is this what's happening? This is certainly a possibility. It could also be happening further up the chain. You can try adding the following to Store Settings > Advanced > Page Header Code Injection for the store page. Please see per-page code injection. <meta http-equiv="expires" content="0"> Let us know how it goes. Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support! Link to comment
LKW Posted September 9, 2022 Author Share Posted September 9, 2022 On 9/7/2022 at 10:30 PM, creedon said: You can try adding the following to Store Settings > Advanced > Page Header Code Injection for the store page. Please see per-page code injection. <meta http-equiv="expires" content="0"> Let us know how it goes. Thank you for the tip! But, sadly, it seems to have made no difference. And then I found this dispiriting info (which I suspect you authored):https://sf.digital/squarespace-solutions/why-doesnt-my-code-work-until-i-refresh-the-page from which I infer that the only remedy is the site-wide removal Ajax page load optimization. Our site is so teeny this might be feasible, except that we have lots of huge images (e.g., 171 on the product page in question) and I worry that they would be reloaded unnecessarily. So, we're going with the jenky "Refresh page for latest stats!" text. Sigh... Link to comment
creedon Posted September 9, 2022 Share Posted September 9, 2022 Quote And then I found this dispiriting info (which I suspect you authored):https://sf.digital/squarespace-solutions/why-doesnt-my-code-work-until-i-refresh-the-page That is @paul2009's work. Quote I infer that the only remedy is the site-wide removal Ajax page load optimization. I suggest turning it off short term to see if that solves the issue. Quote except that we have lots of huge images (e.g., 171 on the product page in question) and I worry that they would be reloaded unnecessarily. I think Ajax doesn't help with images. It is designed to reduce the number of times structural elements, like the site header, are reloaded. The browser handles the caching of media, like images. Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support! Link to comment
LKW Posted September 9, 2022 Author Share Posted September 9, 2022 7 minutes ago, creedon said: That is @paul2009's work. Oops, sorry, got my experts mixed up. You're all great! creedon and paul2009 1 1 Link to comment
paul2009 Posted September 9, 2022 Share Posted September 9, 2022 (edited) 51 minutes ago, LKW said: I found this...from which I infer that the only remedy is the site-wide removal Ajax page load optimization. If you're using a Montauk family template, it doesn't have this feature 🙂 Edited September 9, 2022 by paul2009 creedon and LKW 2 Improve your online store with our extensions.About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. Content: Links in my posts may refer to SF Digital products or may be affiliate links.Catch up on all the release notes and announcements 2023 [for Circle members only] (there's a public version here)Buy me a coffee Link to comment
LKW Posted September 10, 2022 Author Share Posted September 10, 2022 21 hours ago, paul2009 said: If you're using a Montauk family template, it doesn't have this feature 🙂 Oh. Well, good... I guess. At least it saves me going down that rabbit hole. Link to comment
LKW Posted September 10, 2022 Author Share Posted September 10, 2022 @creedon This morning I did get a refreshed page when I reopened it in my test browser after updating prices, so perhaps the "expires" tag is working after all. Maybe it just needed a couple of days to propagate to all the places it's cached. Link to comment
LKW Posted September 11, 2022 Author Share Posted September 11, 2022 23 hours ago, LKW said: @creedon This morning I did get a refreshed page when I reopened it in my test browser after updating prices, so perhaps the "expires" tag is working after all. But not in all browsers. It's now refreshing on reload in Safari, but not in Chrome or Firefox. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment