Cache
Cache, or caching, is a technique used to store and reuse the results of expensive operations to improve performance.
There are different types of caches, depending on where they are applied: opcode cache, data cache, query cache, etc.
<?php
$count = count($array);
// $count is a cache for the number of elements in the array
// it saves a call to count() for every loop
for($i = 0; $i < $count; ++$i) {
doSomething($i);
}
?>
See Also
Related
- Memoization
- Hoisting
- Horizontal Scaling
- Search Engine
- Search Engine Optimization (SEO)
- Serialization
- var_export()
- Determinism
- Load Balancer
- Deduplication
- Fingerprint
- Latency
- Rate Limiting
- Replay
- Time To Live (TTL)
- Cache Stampede
- CDN
- Eventual Consistency
- Shared Memory
- Temporary
- APCu
- Redis
- Source Of Truth
- Stale-While-Revalidate