Version the blog entry images to bust the cache

This commit is contained in:
Kevin MacMartin 2018-05-11 00:31:34 -04:00
parent 75f0b2705a
commit c48db55fb5

View file

@ -50,7 +50,7 @@ class Blog extends DashboardModel
// Add the header image if one exists // Add the header image if one exists
$header_image_path = '/uploads/blog/img/' . $blog_entry->id . '-header-image.jpg'; $header_image_path = '/uploads/blog/img/' . $blog_entry->id . '-header-image.jpg';
$blog_entry['headerimage'] = file_exists(base_path() . '/public' . $header_image_path) ? $header_image_path : ''; $blog_entry['headerimage'] = file_exists(base_path() . '/public' . $header_image_path) ? $header_image_path . '?version=' . $blog_entry->timestamp() : '';
// Add the processed blog entry to the array // Add the processed blog entry to the array
array_push($blog_entries, $blog_entry); array_push($blog_entries, $blog_entry);