Questions tagged [caching]

A cache is a mechanism for temporarily storing (caching) data locally in order to reduce access time to data stored far away. For CPU/disk/web browsing please use relevant tags (cpu-cache, diskcache,...)

A cache is a mechanism that involves temporarily storing data in places that are faster to access than the original storage location. can be machine code instructions, images, documents, or web pages, for example. The purpose of a cache is to reduce access time, bandwidth usage, server load, and perceived lag.

Different applications where cache mechanisms are used include:

Useful Links

35446 questions
2759
votes
7 answers

Flash CS4 refuses to let go

I have a Flash project, and it has many source files. I have a fairly heavily-used class, call it Jenine. I recently (and, perhaps, callously) relocated Jenine from one namespace to another. I thought we were ready - I thought it was time. The new…
Ender
  • 26,673
  • 7
  • 25
  • 33
2615
votes
21 answers

Ignore files that have already been committed to a Git repository

I have an already initialized Git repository that I added a .gitignore file to. How can I refresh the file index so the files I want ignored get ignored?
trobrock
  • 44,089
  • 11
  • 35
  • 44
1680
votes
29 answers

How do we control web page caching, across all browsers?

Our investigations have shown us that not all browsers respect the HTTP cache directives in a uniform manner. For security reasons we do not want certain pages in our application to be cached, ever, by the web browser. This must work for at least…
Edward Wilde
  • 23,831
  • 8
  • 52
  • 64
1660
votes
33 answers

Disabling Chrome cache for website development

I am modifying a site's appearance (CSS modifications) but can't see the result on Chrome because of annoying persistent cache. I tried Shift+refresh but it doesn't work. How can I disable the cache temporarily or refresh the page in some way that I…
tomermes
  • 21,672
  • 15
  • 39
  • 61
1485
votes
17 answers

Memcached vs. Redis?

We're using a Ruby web-app with Redis server for caching. Is there a point to test Memcached instead? What will give us better performance? Any pros or cons between Redis and Memcached? Points to consider: Read/write speed. Memory usage. Disk I/O…
Sagiv Ofek
  • 24,614
  • 6
  • 57
  • 53
1090
votes
25 answers

Is Safari on iOS 6 caching $.ajax results?

Since the upgrade to iOS 6, we are seeing Safari's web view take the liberty of caching $.ajax calls. This is in the context of a PhoneGap application so it is using the Safari WebView. Our $.ajax calls are POST methods and we have cache set to…
user1684978
  • 8,449
  • 3
  • 11
  • 6
1057
votes
55 answers

How to force the browser to reload cached CSS and JavaScript files

I have noticed that some browsers (in particular, Firefox and Opera) are very zealous in using cached copies of .css and .js files, even between browser sessions. This leads to a problem when you update one of these files, but the user's browser…
Kip
  • 99,109
  • 82
  • 222
  • 258
799
votes
10 answers

What is __pycache__?

From what I understand, a cache is an encrypted file of similar files. What do we do with the __pycache__ folder? Is it what we give to people instead of our source code? Is it just my input data? This folder keeps getting created, what it is for?
user2063042
  • 8,037
  • 3
  • 12
  • 6
796
votes
9 answers

What is a "cache-friendly" code?

What is the difference between "cache unfriendly code" and the "cache friendly" code? How can I make sure I write cache-efficient code?
Noah Roth
  • 8,210
  • 5
  • 17
  • 24
665
votes
8 answers

What's the difference between Cache-Control: max-age=0 and no-cache?

The header Cache-Control: max-age=0 implies that the content is considered stale (and must be re-fetched) immediately, which is in effect the same thing as Cache-Control: no-cache.
rubyruy
  • 7,101
  • 3
  • 16
  • 15
633
votes
28 answers

How can I force clients to refresh JavaScript files?

We are currently working in a private beta and so are still in the process of making fairly rapid changes, although obviously as usage is starting to ramp up, we will be slowing down this process. That being said, one issue we are running into is…
AdamB
  • 7,780
  • 4
  • 19
  • 13
633
votes
9 answers

Read whole ASCII file into C++ std::string

I need to read a whole file into memory and place it in a C++ std::string. If I were to read it into a char[], the answer would be very simple: std::ifstream t; int length; t.open("file.txt"); // open input file t.seekg(0, std::ios::end); //…
Escualo
  • 36,702
  • 18
  • 79
  • 122
451
votes
6 answers

Is there a tag to turn off caching in all browsers?

I read that when you don't have access to the web server's headers you can turn off the cache using: But I also read that this doesn't work in some versions of IE. Are there any set of
leeand00
  • 23,306
  • 34
  • 125
  • 265
415
votes
10 answers

How to clear gradle cache?

I'm trying to use Android Studio, and the first time I boot it up, it takes like 45 MINUTES to compile... If I don't quit the application, it is okay - each subsequent compilation/running the app will take around 45 seconds. I've tried to check some…
David T.
  • 18,561
  • 18
  • 61
  • 115
403
votes
6 answers

What requests do browsers' "F5" and "Ctrl + F5" refreshes generate?

Is there a standard for what actions F5 and Ctrl + F5 trigger in web browsers? I once did experiment in IE6 and Firefox 2.x. The F5 refresh would trigger a HTTP request sent to the server with an If-Modified-Since header, while Ctrl + F5 would not…
Morgan Cheng
  • 66,562
  • 63
  • 166
  • 223
1
2 3
99 100