Questions tagged [cache]

cache is a component that stores data so future requests for that data can be served faster; the data stored in a cache might be the results of an earlier computation, or the duplicates of data stored elsewhere.

461 questions
389
votes
1 answer

How do you empty the buffers and cache on a Linux system?

Prior to doing some benchmarking work how would one free up the memory (RAM) that the Linux Kernel is consuming for its buffers and cache? Note that this is mostly useful for benchmarking. Emptying the buffers and cache reduces performance! If…
slm
  • 363,520
  • 117
  • 767
  • 871
358
votes
4 answers

How do I clear Bash's cache of paths to executables?

When I execute a program without specifying the full path to the executable, and Bash must search the directories in $PATH to find the binary, it seems that Bash remembers the path in some sort of cache. For example, I installed a build of…
Daniel Trebbien
  • 3,805
  • 2
  • 15
  • 9
120
votes
7 answers

Can I safely remove /var/cache?

I am running out of disk space and noted that I have a large /var/cache directory. Can I safely remove this? (using Arch Linux, BTW).
user11780
57
votes
4 answers

How to read the local DNS cache contents?

I know that on Windows I can issue ipconfig /displaydns and I see the local DNS's cache content. How can I list the DNS's cache content in Linux? I would like to get as much as cross-distro solution as possible.
Hanan
  • 5,631
  • 4
  • 28
  • 30
54
votes
8 answers

How to cache or otherwise speed up `du` summaries?

We have a large file system on which a full du (disk usage) summary takes over two minutes. I'd like to find a way to speed up a disk usage summary for arbitrary directories on that file system. For small branches I've noticed that du results seem…
Ian Mackinnon
  • 660
  • 1
  • 7
  • 14
44
votes
2 answers

How can I tell which version of Varnish I'm running?

How can I get the installed Varnish cache version string from the command line?
TravisCarden
  • 541
  • 1
  • 4
  • 8
41
votes
3 answers

Does grep use a cache to speed up the searches?

I have noticed that subsequent runs of grep on the same query (and also a different query, but on the same file) are much faster than the first run (the effect is easily noticeable when searching through a big file). This suggests that grep uses…
Lazer
  • 34,477
  • 25
  • 70
  • 75
36
votes
4 answers

Is it safe to remove ~/.cache?

When I scanned my $HOME directory with baobab (Disk Usage Analyzer), I found that ~/.cache is consuming about half a GB. I also tried to restart and again check size but no difference. So, I am planning to rm -rf ~/.cache. Let me know Is it safe to…
Pandya
  • 23,898
  • 29
  • 92
  • 144
34
votes
3 answers

How can I transparently cache any directory or mounted file system for reads and write back?

Say I mount some cloud storage (Amazon Cloud Drive in my case) with a FUSE client at /mnt/cloud. But because reading and writing files directly to /mnt/cloud is slow because it has to go over the internet, I want to cache the files that I'm reading…
Flecto
  • 471
  • 1
  • 4
  • 7
30
votes
5 answers

Drop a specific file from the Linux filesystem cache?

I know I can drop everything from the Linux filesystem cache, but is there a way to drop just one specific file? Or prevent a file from being cached? Or tell a process not to cache any files it writes? I have a process that reads a lot of little…
Jay Hacker
  • 671
  • 1
  • 7
  • 10
29
votes
3 answers

How to flush local DNS cache in CentOS

I'm looking for a way to flush the local DNS cache on a CentOS 6. The system is not running any DNS server or anything, and I wish to let every DNS query go out to the configured nameserver, even for the duplicate ones. Most of what I found online…
fy_iceworld
  • 391
  • 1
  • 3
  • 4
27
votes
1 answer

Why does Chromium not cache DNS for more than a minute?

I use Chromium and have problems with the DNS not being cached for the time that I would expect. Take the example.com domain. According to the DNS settings, this domain should be cached for another 26151 seconds: $ dig example.com ;; ANSWER…
user32421
  • 347
  • 5
  • 10
21
votes
7 answers

Linux equivalent to ReadyBoost?

Is there a kernel module or some other patch or something similar to Windows' ReadyBoost? Basically I'm looking for something that allows disk reads to be cached on a Flash drive.
Nathan Osman
  • 6,170
  • 10
  • 40
  • 51
21
votes
2 answers

Is it necessary to explicitly flush the HDD on-disk write caches?

Abstract Sometimes, the Linux kernel is not aware of on-drive write caches of external USB storage devices. Is it necessary in such situations to explicitly flush those caches prior detaching these devices? Example I use a WD Elements external USB…
Jürgen
  • 662
  • 5
  • 14
21
votes
1 answer

What command can I use to clear the 'yum' cache, on Fedora 23 system?

What command can I use to clear the yum cache on a Fedora 23 system? I have tried yum clean all, but it defaults to: Redirecting to '/usr/bin/dnf clean all' (see 'man yum2dnf') with "0 files removed"
eHansen
  • 321
  • 1
  • 2
  • 5
1
2 3
30 31