Jason Prado
Jason Prado

Reputation: 1503

Is there a difference between precaching and prefetching?

It seems they are two names for the same idea– is there any difference?

Upvotes: 5

Views: 1838

Answers (1)

Miguel Ping
Miguel Ping

Reputation: 18347

Disclaimer: I do not know of any literature specifically making (or not making) distinctions between precaching and prefetching.

Caching is a harder problem than fetching. Caching involves invalidation (knowing when a cache entry is no longer valid), may involve other aspects such as distributed caches, and may or may not be transparent to the application.

Fetching is related to getting something you will need. Thus, IMHO prefetching (the word) should be used when

  1. you will likely need the data in the immediate future
  2. the data will probably be acessed once
  3. you can discard the data after using it

Think of an instruction prefetch for a branch prediction algorithm on a microprocessor, for example.

Caching is related to having a copy of the actual data on a faster medium, say an L2 cache or a memcached server. Thus, precaching is different than prefetching because of the usage: caching typically involves many reads, and some invalidation mecanism, thus a precaching mechanism would be used to populate some cache with frequently acessed items, for example.

Upvotes: 3

Related Questions