What is the difference between buffer and cache memory in Linux?

To me it’s not clear what’s the difference between the two Linux memory concepts : buffer and cache. I’ve read through this post and it seems to me that the difference between them is the expiration policy: buffer’s policy is first-in, first-out cache’s policy is Least Recently Used. Am I right? In particular, I’m looking … Read more

What is the difference between HTTP status code 200 (cache) vs status code 304?

I’m using the Google “Page Speed” plug-in for Firefox to access my web site. Some of the components on my page is indicated as HTTP status: 200 200 (cache) 304 By Google’s “Page Speed”. What I’m confused about is the difference between 200 (cache) and 304. I’ve refreshed the page multiple times (but have not … Read more

Is there a decorator to simply cache function return values?

Consider the following: @property def name(self): if not hasattr(self, ‘_name’): # expensive calculation self._name = 1 + 1 return self._name I’m new, but I think the caching could be factored out into a decorator. Only I didn’t find one like it 😉 PS the real calculation doesn’t depend on mutable values 19 Answers 19