Link to home
Start Free TrialLog in
Avatar of doey
doeyFlag for Ireland

asked on

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

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?
Avatar of Terry Woods
Terry Woods
Flag of New Zealand image

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.
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.
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.
Avatar of doey

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of doey

ASKER

Although my solution required a different approach, this led me in the right direction.

Thanks Dave
You're welcome, glad to help.