Skip to content

Commit 77808bc

Browse files
committed
Prevent theses and items sitemap view from using the same cache key #3361
* adds a distinct cache key to the partial used by both the theses and items sitemap view
1 parent 3fd4700 commit 77808bc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/views/sitemap/_object.xml.builder

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
xml.instruct! :xml, version: '1.0'
2-
cache 'sitemap', expires_in: 24.hours do
2+
cache cache_key, expires_in: 24.hours do
33
xml.urlset(xmlns: 'http://www.sitemaps.org/schemas/sitemap/0.9') do
44
xml.url do
55
xml.loc root_url

app/views/sitemap/items.xml.builder

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
xml << render(partial: 'object', locals: { objects: @items })
1+
xml << render(partial: 'object', locals: { objects: @items, cache_key: 'sitemap-items' })

app/views/sitemap/theses.xml.builder

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
xml << render(partial: 'object', locals: { objects: @theses })
1+
xml << render(partial: 'object', locals: { objects: @theses, cache_key: 'sitemap-theses' })

0 commit comments

Comments
 (0)