How to prevent Browser cache on Angular 2 site?

angular-cli resolves this by providing an –output-hashing flag for the build command (versions 6/7, for later versions see here). Example usage: ng build –output-hashing=all Bundling & Tree-Shaking provides some details and context. Running ng help build, documents the flag: –output-hashing=none|all|media|bundles (String) Define the output filename cache-busting hashing mode. aliases: -oh <value>, –outputHashing <value> Although this … Read more

What is the difference between Caching and Memoization?

Memoization is a specific form of caching that involves caching the return value of a function based on its parameters. Caching is a more general term; for example, HTTP caching is caching but not memoization. Wikipedia says: Although related to caching, memoization refers to a specific case of this optimization, distinguishing it from forms of … Read more

How does one write code that best utilizes the CPU cache to improve performance?

The cache is there to reduce the number of times the CPU would stall waiting for a memory request to be fulfilled (avoiding the memory latency), and as a second effect, possibly to reduce the overall amount of data that needs to be transfered (preserving memory bandwidth). Techniques for avoiding suffering from memory fetch latency … Read more

Redis cache vs using memory directly

Redis is a remote data structure server. It is certainly slower than just storing the data in local memory (since it involves socket roundtrips to fetch/store the data). However, it also brings some interesting properties: Redis can be accessed by all the processes of your applications, possibly running on several nodes (something local memory cannot … Read more

Difference between no-cache and must-revalidate for Cache-Control?

I believe that must-revalidate means : Once the cache expires, refuse to return stale responses to the user even if they say that stale responses are acceptable. Whereas no-cache implies : must-revalidate plus the fact the response becomes stale right away. If a response is cacheable for 10 seconds, then must-revalidate kicks in after 10 … Read more

Is Redis just a cache?

No, Redis is much more than a cache. Like a Cache, Redis stores key=value pairs. But unlike a cache, Redis lets you operate on the values. There are 5 data types in Redis – Strings, Sets, Hash, Lists and Sorted Sets. Each data type exposes various operations. The best way to understand Redis is to … Read more