Solved

Get a certain webpage to load everytime and ignore previous cache settings

Posted on 2016-09-28
7
103 Views
Last Modified: 2016-11-03
Hi There

I am doing a website for a client and part of it requires that the visitor is displayed a list of the nearest locations. This involves the use of the geo-locate function. Most browsers (desktop or mobile) require that the user select "Allow" or "Deny". Which is perfect. But if someone presses Deny just the once, then they do not get asked the question again.

What we would like to do is disregard the cache on the page every time they visit. By all means let them choose again if they wish to share their location or not. But we need to give them the option to decide everytime.

Our scripting guy is saying that they cannot use the no-cache no-store function to achieve this and there is no other way to do it so we just have to forget about it. I find this difficult to believe. There must be some way to either disregard a pages cache on load or to force the permission to be asked everytime.

Any suggestions?
0
Comment
Question by:doey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41820449
Google provides an article dedicated to helping you get the users' location: https://developers.google.com/web/fundamentals/native-hardware/user-location/user-consent?hl=en

It sounds like, depending on browser behaviour which is beyond the control of the developer, you may only get to request the location once per domain, which is why Google is saying above how important it is to not just request it on loading the landing page of the site.
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41820497
It is possible to detect when the user has declined to provide their location, in which case the best thing you can do is to link to instructions which tells them how to adjust browser settings to re-enable it.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41820504
I almost always click on Deny when I get those requests.  On the one site I did with Google Maps, we asked for the users location to display the closest locations and did not use the browser geo-location.  I don't think you can force the browsers the way you want.
0
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

 

Author Comment

by:doey
ID: 41822294
Hi Dave

You say that on a particular website you "asked for the users location to display the closest locations and did not use the browser geo-location." Do you mean that you physically asked for them to type in their location?
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 41822355
Yes, it's a form that let's them enter their address and returns a Google map with the locations nearest them.  It's on this page:  http://www.darkhorsecrankworks.com/dealer.html
0
 

Author Closing Comment

by:doey
ID: 41871962
Although my solution required a different approach, this led me in the right direction.

Thanks Dave
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41872416
You're welcome, glad to help.
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
The viewer will learn how to count occurrences of each item in an array.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question