ElI5 why is the ‘cache’ this all powerful crasher of apps and causer of problems? Why does clearing it fix things?

603 views

ElI5 why is the ‘cache’ this all powerful crasher of apps and causer of problems? Why does clearing it fix things?

In: 101

22 Answers

Anonymous 0 Comments

The cache in the case I think you’re asking about is a bit of storage tucked away to keep frequently used assets so that the app in question has to download less stuff to run. If something in there is wrong in a way that the app understands (wrong version or obviously the wrong size), it can just overwrite it with a new version, but if it’s wrong in a way the app doesn’t understand (only slightly wrong or with a corrupt bit of data in the middle due to an error somewhere in the chain of either writing it the first time or overwriting it at some point), then it can cause crashes. Clearing the cache deletes whatever was faulty and forces a re-download of the correct file on next launch.

Anonymous 0 Comments

The word “cache” means a collection of items stored in a hidden or otherwise inaccessible place. So you could have a cache of candy hidden from children for example. In computers a cache is a place to store data temporarily. An example would be when a web browser downloads all the data to display a web page then you move on to another one, the browser will want to store the data for the previous page somewhere other than active memory. It doesn’t need to take up the extremely fast RAM but it doesn’t want to download everything again if you press the back button, so there is a folder somewhere with all that data stored away for a time.

If something goes wrong and there is some of that stored data causing the program to have a problem, clearing the cache can help restore things to normal. The browser might be trying to display a web page from the cache but those files were corrupted and the browser goes haywire. Without those files the browser would need to download them again, getting the correct files and not having a problem anymore.

Anonymous 0 Comments

The cache is just a place where data is stored. If that data is in an unexpected format when the app tries to read it then it will have issues. For example, if a list contains letters instead of numbers or if the list only has 3 elements when it is expected to have 5 then the program will crash when it tries to use those values. Some programs can handle this better than others.

Why is the data messed up? Maybe some other program messed with it, or maybe some older/newer version of the program stored the data differently. Maybe it just got corrupted due to a read/write error. Clearing the cache resets everything and lets the program store fresh data that doesn’t have any issues. Its like buying a new car when you can’t figure out what is wrong with your old one.

Anonymous 0 Comments

Cache refers to storage, often tucked away.

A browser cache is a place for your web browser to store some info, mostly a way to “remember” what web pages “look like”. The purpose of this is so that every time you visit a web page your computer doesn’t need to spend time and resources asking the servers what the page should look like and it can make certain assumptions based off of its (the computer’s) memory (cache).

The reason clearing the cache can help is that sometimes the computer’s memory is wrong. Sometimes the page changed enough that the “assumptions” your computer is making no longer apply, sometimes computers just do weird things. But the point is that clearing the browser cache forces the computer to request all the info and not assume anything. It will then rebuild this cache so that it can go back to working off “memory”. In a way, this is another form of “turn it off and back on again”. Your computer using its own assumptions is intended, and good, but sometimes you need it to forget what it “thought it knew” and start fresh.

Anonymous 0 Comments

A cache is sort of like a computer’s public storage or parking lot; any program can access it, and some programs access it differently than other ones. Heck, even one program will sometimes have different processes that use the cache slightly weird, which then messes it up for the rest of the program. As a bonus, sometimes it’s a [PEBKAC](https://en.wiktionary.org/wiki/PEBCAK), which can be the hardest of errors to diagnose because the program will assume the ‘error’ is on purpose.

So clearing the cache just resets it all. No second programs making surprise changes, no glitches making small bugs, and no PEBKAC settings making everything messed up. Everything starts fresh. It’s basically a more specialized version of “Did you try turning it off and then on again?” (which has a [wiki page](https://en.wikipedia.org/wiki/Power_cycling)).

Anonymous 0 Comments

It depends on the circumstance but ‘cache’ is a general term used in a couple of areas. CPUs have a cache memory which makes the already fast process of retrieving information from memory even *faster*. Higher quality chips tend to have more of it. A cache in a database is a collection previously run queries. Say user A queries a database and user B comes along and queries a subset of that. We call that a ‘cache hit’, since the system already got the data for user A; no need to go back to the database for the same information. Database lookups are orders of magnitude slower than a cache hit. There are some databases, like redis, whose essential function is to get as much useful data as it can into cache so it can process millions of transactions.

Caches aren’t perfect, sometimes an update will happen to data after data has been put in cache, but before the cache expires. You may get old data out of the system. Some version of that is the reason for most cache problems, the cache you have access to is incomplete or old. If you clear the cache, you force the system to get all new data, even though it is a little slower. That is why it seems like a God fix, it is like resetting everything to zero and starting over.

Anonymous 0 Comments

It’s a constantly changing and searched upon storage that is often hard to test under all conditions and sufficiently long enough.

Clearing it is a (logically) fresh start.

Anonymous 0 Comments

A cache is an area of storage memory space. Think of it like this:

You have a 5 gallon bucket. You have a cup. You use the cup to dip water from the bucket, and occasionally refill the bucket. (You can also use a hose to fill the bucket.)

The bucket is your Random Access Memory, or RAM. It is used to run your apps. The cup is the cache. The hose is the Internet bandwidth connection.

Sometimes the bucket overflows. That’s a crash. Sometimes the water is dirty, either from the cup or the hose. That can cause a crash.

The REAL reason that crashes happen is because the code used to run all this is flawed. It has this thing called ‘garbage collection.’ When memory becomes corrupted, it causes a crash. The garbage collection is supposed to prevent that, but almost ALL code does this poorly.

Clearing the cache allows the garbage collection code to complete emptying the trash, so to speak. And then, it all starts again, until the next time.

Anonymous 0 Comments

Simplest terms, a Cache is a local storage. In the context of the question it is often configuration or state information that is being stored locally. For the most part this information is stored to increase load times or remember information about something (like a login).

The reason clearing a cache often solves problems is because the source of the information (server, website, etc) cannot control the data in the cache, but the cache is being used to interact with the source.

Example, let’s say you change your login information. For whatever reason it is cached locally from before the change. At this point the local login information in the cache no longer matches the real login information. It either needs to be deleted or updated.

Anonymous 0 Comments

Bucause caching is one of the 3 hardest problems in programming. The other one is naming things.