Commit 56c2d9df authored by John Long's avatar John Long

Use feed's last change for caching generated feed in Redis, pubdate

Related to #14
parent 489e9f29
Pipeline #63411968 passed with stages
in 2 minutes and 39 seconds
......@@ -123,9 +123,6 @@ class ShowController extends Controller
$feed->load('items');
// @todo remove after feeds have updated
$date = $feed->last_change ?: $feed->last_refresh;
$date = $feed->last_change->format('D, d M Y H:i:s ') . 'GMT';
if ($this->isCachedByClient($request, $date)) {
......
......@@ -6,7 +6,7 @@ use App\Item;
use Illuminate\Support\Facades\Redis;
$user = app(User::class);
$cache_key = 'feed:' . $feed->id . $feed->updated_at->getTimestamp();
$cache_key = 'feed:' . $feed->id . $feed->last_change->getTimestamp();
$cache = Redis::get($cache_key);
if ($cache) {
......@@ -46,7 +46,7 @@ $atom['type'] = "application/rss+xml";
$channel->addChild('link', $url);
$channel->title = $feed->title;
$channel->addChild('lastBuildDate', $feed->updated_at->format(DateTime::RSS));
$channel->addChild('lastBuildDate', $feed->last_change->format(DateTime::RSS));
$channel->addChild('block', 'yes', $itunes_ns);
$channel->addChild('block', 'yes', $googleplay_ns);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment