You are here

public function GeocoderPlugin::cache_set in Geocoder 7.2

Stores data in the persistent cache.

The reasons for having several bins are as follows:

Parameters

$cid: The cache ID of the data to store.

$data: The data to store in the cache. Complex data types will be automatically serialized before insertion. Strings will be stored as plain text and are not serialized. Some storage engines only allow objects up to a maximum of 1MB in size to be stored by default. When caching large arrays or similar, take care to ensure $data does not exceed this size.

Overrides GeocoderPluginInterface::cache_set

See also

cache_set()

4 calls to GeocoderPlugin::cache_set()
Provider::geocode in src/Plugin/Geocoder/Provider.php
Geocode data
Provider::reverse in src/Plugin/Geocoder/Provider.php
Reverse geocode latitude and longitude.
Random::geocode in src/Plugin/Geocoder/Provider/Random.php
Geocode data
Random::reverse in src/Plugin/Geocoder/Provider/Random.php
Reverse geocode latitude and longitude.

File

src/Plugin/GeocoderPlugin.php, line 68
Contains \Drupal\geocoder\Plugin\GeocoderPlugin.

Class

GeocoderPlugin

Namespace

Drupal\geocoder\Plugin

Code

public function cache_set($cid, $data) {
  if ((bool) Config::get('geocoder.cache', TRUE)) {
    cache_set($cid, $data, 'cache_geocoder', CACHE_PERMANENT);
  }
}