Torann / laravel-geoip

Determine the geographical location of website visitors based on their IP addresses.

Home Page:http://lyften.com/projects/laravel-geoip

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some problems with caching

pwnz22 opened this issue · comments

Hello!

I have problems with caching.

I have to routes like so:

Route::get('/', 'Controller@method');
Route::get('{city}', 'Controller@mehtod')->name('city');

First route getting the location and redirecting to the second route:
return redirect(route('city', [$city]), 301);

In the first routes method i have statement that checks cookie if it has a variable city
and if not:

$city = geoip()->getLocation($request->ip());
return redirect(route('city', [$city]), 301);

Now when i'm entering the site browser immediately redirects me to the second route with the cached city.
And what i need is that everytime the user requests '/' it must go to the first route and then to the second. But now it's not getting city from cookie if it's there....
okololo.ru - here is website.

In the config i have set'cache' => 'none'but with that also works the same(

sorry for my english :(

Browser caching the 301 redirect, that was the issue.