@@ -148,9 +148,9 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | $cache = Craft::$app->getCache(); |
| 151 | - $uniqueKey = $groupId . $type . $handle . $siteId; |
|
| 152 | - $cacheKey = self::CACHE_KEY . $uniqueKey; |
|
| 153 | - $queueJobCacheKey = self::QUEUE_JOB_CACHE_KEY . $uniqueKey; |
|
| 151 | + $uniqueKey = $groupId.$type.$handle.$siteId; |
|
| 152 | + $cacheKey = self::CACHE_KEY.$uniqueKey; |
|
| 153 | + $queueJobCacheKey = self::QUEUE_JOB_CACHE_KEY.$uniqueKey; |
|
| 154 | 154 | $result = $cache->get($cacheKey); |
| 155 | 155 | // If the sitemap isn't cached, start a job to create it |
| 156 | 156 | if ($result === false) { |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $dependency = new TagDependency([ |
| 188 | 188 | 'tags' => [ |
| 189 | 189 | self::GLOBAL_SITEMAP_CACHE_TAG, |
| 190 | - self::CACHE_KEY . $uniqueKey, |
|
| 190 | + self::CACHE_KEY.$uniqueKey, |
|
| 191 | 191 | ], |
| 192 | 192 | ]); |
| 193 | 193 | $cache->set($queueJobCacheKey, $jobId, $cacheDuration, $dependency); |
@@ -219,11 +219,11 @@ discard block |
||
| 219 | 219 | // Return an empty XML document |
| 220 | 220 | $lines[] = '<?xml version="1.0" encoding="UTF-8"?>'; |
| 221 | 221 | $lines[] = '<?xml-stylesheet type="text/xsl" href="sitemap-empty.xsl"?>'; |
| 222 | - $lines[] = '<!-- ' . Craft::t('seomatic', 'This sitemap has not been generated yet.') . ' -->'; |
|
| 223 | - $lines[] = '<!-- ' . Craft::t('seomatic', 'If you are seeing this in local dev or an') . ' -->'; |
|
| 224 | - $lines[] = '<!-- ' . Craft::t('seomatic', 'environment with `devMode` on, caches only') . ' -->'; |
|
| 225 | - $lines[] = '<!-- ' . Craft::t('seomatic', 'last for 30 seconds in local dev, so it is') . ' -->'; |
|
| 226 | - $lines[] = '<!-- ' . Craft::t('seomatic', 'normal for the sitemap to not be cached.') . ' -->'; |
|
| 222 | + $lines[] = '<!-- '.Craft::t('seomatic', 'This sitemap has not been generated yet.').' -->'; |
|
| 223 | + $lines[] = '<!-- '.Craft::t('seomatic', 'If you are seeing this in local dev or an').' -->'; |
|
| 224 | + $lines[] = '<!-- '.Craft::t('seomatic', 'environment with `devMode` on, caches only').' -->'; |
|
| 225 | + $lines[] = '<!-- '.Craft::t('seomatic', 'last for 30 seconds in local dev, so it is').' -->'; |
|
| 226 | + $lines[] = '<!-- '.Craft::t('seomatic', 'normal for the sitemap to not be cached.').' -->'; |
|
| 227 | 227 | $lines[] = '<urlset>'; |
| 228 | 228 | $lines[] = '</urlset>'; |
| 229 | 229 | } |
@@ -244,9 +244,9 @@ discard block |
||
| 244 | 244 | public function invalidateCache(string $handle, int $siteId) |
| 245 | 245 | { |
| 246 | 246 | $cache = Craft::$app->getCache(); |
| 247 | - TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG . $handle . $siteId); |
|
| 247 | + TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG.$handle.$siteId); |
|
| 248 | 248 | Craft::info( |
| 249 | - 'Sitemap cache cleared: ' . $handle, |
|
| 249 | + 'Sitemap cache cleared: '.$handle, |
|
| 250 | 250 | __METHOD__ |
| 251 | 251 | ); |
| 252 | 252 | } |