Forum Moderators: open

Message Too Old, No Replies

Forcing a Page Refresh

Visitors need to see updated page

         

tigerflag

2:30 pm on Oct 22, 2007 (gmt 0)

10+ Year Member



I have an e-commerce site built on static HTML and CSS. It's hosted on a shared server. I'm switching to a new (3rd-party web-based) shopping cart, which means changing all the "Add to Cart" and "View Cart" links on every page.

I want visitors to see the updated pages, not cached pages that would take them to the old shopping cart.

How can I best achieve this? I don't need a refreshed page every time they hit their Back button, but maybe that will be unavoidable?

I've read about different Metatags such as "META Pragma" and "META Expires", but I'm still somewhat confused.

Thanks for your help.

rocknbil

7:45 pm on Oct 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Seems like the simplest method would be to change the URL to your cart and provide a 301 moved permanently for all queries to the old cart.

The issue is same of CSS - sometimes a cached copy will call up the "old" css after making changes. When I make changes to a CSS file I (try) to change the css link to a new file name, this forces the new CSS sheet.

Demaestro

8:42 pm on Oct 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A trick I used about 2 years ago was to add a random query string to the page when it gets hit so that it "appears" to be unique and would cause the browser to get a new page.... I am not sure if this would till work, but it did then.

http://www.example.com/shopping_cart?random_string=sdlfkjsdklf

So if you write some code to dynamically add a random query string that should get the browser fetching a new page at time of load.

tigerflag

9:19 pm on Oct 22, 2007 (gmt 0)

10+ Year Member



Thank you both.

rockinbill, assuming I can make a 301 (I don't know how to go about it), what would my customers experience if they clicked on the old link? Would they get a page error, or get taken to the new cart, or...?

I don't think the random string approach will work, for the simple fact that both the old and new carts are on different domains than my site. I can't change their URLs. Unless I misunderstood you.

For example: my site looks like: http ://www.mystore.com/item-for-sale.html

The link to the cart looks like:
http ://www.3rdparty-cart.net/cgi-bin/cart.cgi?...etc...

And FWIW, my DOCTYPE is HTML 4.01 Strict.

Demaestro

5:52 pm on Oct 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Tiger you understood me correctly. You would need to be able to have control of the second server.

rocknbil

6:42 pm on Oct 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



rockinbill, assuming I can make a 301 (I don't know how to go about it), what would my customers experience if they clicked on the old link? Would they get a page error, or get taken to the new cart, or...?

Yes when you said "shared server" I was making the assumption your current cart was hosted on your server. If that were the case, you could do a 301 redirect from all the old pages and the user's experience would be that it would immediately take them to the new version, and provide a 301 permanently moved header for the search engines.

However, if the current cart is on an external server, you will have to see what options your current provider has for redirecting the pages - probably few or none.

Since the problem is cached pages, anything you put right in the page like a http-refresh or expired header would be of little use since their cached copy wouldn't contain those.

Leave them both up until current cart activity completely ceases, I guess? Maybe someone here has a better idea.