简体   繁体   中英

Is there a difference between precaching and prefetching?

看来他们是同一个想法的两个名字 - 有什么区别吗?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM