I might have just flooded your RSS feed. Sorry!

Written on 2025-12-11

I'm currently merging Aggregate into this blog so that everything is managed in the same project. That's all going well, although I might have just made a very annoying mistake that might have caused your RSS reader to fill up with Aggregate's content instead of this blog's content.

My mistake was that I cached both rendered RSS feeds for an hour, but mistakenly used the same cache key for my blog's feed and Aggregate's feed 🫣

#[Stateless, Get('/rss')]
public function __invoke(ViewRenderer $viewRenderer, Cache $cache): Response
{
    $xml = $cache->resolve(
        key: 'rss', // 👈 this should have been 'feed-rss'
        callback: fn () => $viewRenderer->render(view(
            __DIR__ . '/feed-rss.view.php',
            posts: Post::published()
                ->orderBy('publicationDate DESC')
                ->limit(50)
                ->all(),
        )),
        expiration: DateTime::now()->plusHours(1),
    );

    return new Ok($xml)->addHeader('Content-Type', 'application/xml;charset=UTF-8');
}

The problem was in production for about a minute or two, so I'm not sure whether your RSS reader actually picked up on it or not. If so, then I'm super sorry for the annoyance! Don't hesitate to let me know in the comments or via email whether you had any issues or not.

Things I wish I knew when I started programming

Things I wish I knew when I started programming cover image

This is my newest book aimed at programmers of any skill level. This book isn't about patterns, principles, or best practices; there's actually barely any code in it. It's about the many things I've learned along the way being a professional programmer, and about the many, many mistakes I made along that way as well. It's what I wish someone would have told me years ago, and I hope it might inspire you.

Read more

Comments

Loading…

Feedly didn't flood, so you're okay there.

Written by Derik Badman on 2025-12-11
Noticed a tpyo? You can submit a PR to fix it.
HomeRSSNewsletterDiscord© 2025 stitcher.io Login