Skip to content

Commit

Permalink
Use geolocation version for cachebusting
Browse files Browse the repository at this point in the history
Avoid issues where users need to refresh or clear cache when geolocation
JS/CSS is updated.
  • Loading branch information
zerocrates committed Apr 16, 2020
1 parent 6e15ec4 commit 3860d55
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions GeolocationPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,17 @@ public function hookPublicHead($args)

private function _head()
{
queue_css_file('leaflet/leaflet', null, null, 'javascripts');
queue_css_file('geolocation-marker');
queue_js_file(array('leaflet/leaflet', 'leaflet/leaflet-providers', 'map'));
$pluginLoader = Zend_Registry::get('plugin_loader');
$geolocation = $pluginLoader->getPlugin('Geolocation');
$version = $geolocation->getIniVersion();
queue_css_file('leaflet/leaflet', null, null, 'javascripts', $version);
queue_css_file('geolocation-marker', null, null, 'css', $version);
queue_js_file(array('leaflet/leaflet', 'leaflet/leaflet-providers', 'map'), 'javascripts', array(), $version);

if (get_option('geolocation_cluster')) {
queue_css_file(array('MarkerCluster', 'MarkerCluster.Default'), null, null,
'javascripts/leaflet-markercluster');
queue_js_file('leaflet-markercluster/leaflet.markercluster');
'javascripts/leaflet-markercluster', $version);
queue_js_file('leaflet-markercluster/leaflet.markercluster', 'javascripts', array(), $version);
}
}

Expand Down

0 comments on commit 3860d55

Please sign in to comment.