---
title: "Comment by Manjunath Reddy on \"Code Smell 49 - Caches\" | Hashnode"
description: "Hey Maxi, love all the series about the Code smell :-). Just a curious about this line return $this-&gt;inbox-&gt;retrieveAndRemove($title); Here, we retrieve t"
url: "https://hashnode.com/posts/code-smell-49-caches/5fd2e36a1b71d6573621af3e/comment/66e340b92ce7ef1f2788a97e"
---

[Discussion](https://hashnode.com/posts/code-smell-49-caches/5fd2e36a1b71d6573621af3e)

Comment [Code Smell 49 - Caches](https://hashnode.com/posts/code-smell-49-caches/5fd2e36a1b71d6573621af3e)

[Manjunath Reddy](https://hashnode.com/@manjufy)

[Sep 12, 2024](https://hashnode.com/posts/code-smell-49-caches/5fd2e36a1b71d6573621af3e/comment/66e340b92ce7ef1f2788a97e)

Hey Maxi, love all the series about the Code smell :-).

Just a curious about this line `return $this->inbox->retrieveAndRemove($title);`

Here, we retrieve the title from cache and remove it immediately? Why do we retrieve and remove? Wouldn't it increase the write-to-cache ratio by deleting cache quite often :-) ? whats your thoughts on that?

[Maxi Contieri](https://hashnode.com/@mcsee)

[Sep 12, 2024](https://hashnode.com/posts/code-smell-49-caches/5fd2e36a1b71d6573621af3e/comment/66e340b92ce7ef1f2788a97e#reply-66e341c8d7174d93aa77fea1)

It is about the real life metaphore on retrieving an existing copy (and using it) If you have fungible objects (A real life book is not) you could just retrieve it and keep it. It is like aquiring a lock in this case
