Torann / laravel-geoip

Determine the geographical location of website visitors based on their IP addresses.
http://lyften.com/projects/laravel-geoip
BSD 2-Clause "Simplified" License
2.09k stars 372 forks source link

This cache store does not support tagging #123

Open tontonAurel opened 5 years ago

tontonAurel commented 5 years ago

When updated torann/geoip from 1.0.7 to 1.0.8 i got this error : This cache store does not support tagging. I use file as cache driver and my version of laravel is 5.6.38

brentscholl commented 5 years ago

I also have the same problem after updating from 1.0.7 to 1.0.8

voicecode-bv commented 5 years ago

Use redis for caching as described in the config file:

/* -------------------------------------------------------------------------- Cache Tags
Cache tags are not supported when using the file or database cache
drivers in Laravel. This is done so that only locations can be cleared.
*/
tontonAurel commented 5 years ago

Yes, i'm agree with you but it's minor update (from 1.0.7 to 1.0.8), it should not break the application since we didn't change anything else

codepandit commented 5 years ago

I have a same issue, no matter what I try It doesn't work. I'm using Laravel 5.7 and geoip 1.0.8

rappasoft commented 5 years ago

Agreed, I have cache set to none and it still happens.

Edit:

cache => 'none',
cache_tags => null,

Seems to work.

ashu555 commented 5 years ago

Change your Cache driver to 'array' in .env

brians-code commented 5 years ago

I had commented out the cache_tags line when I first installed the package a year ago for this exact reason, and it's been working fine with file-based caching.

//'cache_tags' => ['torann-geoip-location'],

This update broke it. So what specifically changed is that now cache_tags defaults to on instead of off. Instead of commenting out that line, you now need to explicitly set cache_tags to false or null, like @rappasoft said.

'cache_tags' => false,

Edit: Just to clarify, you can leave caching on and set tags to off. The only thing cache_tags does is make it possible to clear the geoip cache without touching anything else that has been cached.

'cache' => 'all',
'cache_tags' => false,
'cache_expires' => 30,
tiznull commented 4 years ago

This is how I fixed the problem

Setup for GEOIP

Open up config/geoip.php

Tasks for GEOIP

-[ ] Change the service to 'maxmind_database' -[ ] Change the cache tags to a more dynamic method of handling the environment.

Setup the service

service' => 'maxmind_database',

Change the Cache Tags

'cache_tags' => env('CACHE_DRIVER', 'array') === "file" ? null : ['torann-geoip-location'],
felix2056 commented 4 years ago

Don't forget to run php artisan config:cache after editing config/geoip