Sharepoint - Why does everyone say not to delete the cache.ini file?

Cache.ini must exist, and it must have a numeral value contained within it (1 or higher). The cache.ini file closely mirrors the number contained within the Configuration database’s LastUpdate table. This table contains two columns, a Value column and a Version column. The Version column increments on a regular basis, and the cache.ini updates from the Version value. To accomplish this, there is a local Timer Job on each server with the internal name of “job-config-refresh”. This timer job runs on a 15 second interval. The timer job itself validates that the cache.ini has not been invalidated, then runs the stored procedure within the Configuration database, proc_getNewObjects. If the value in the cache.ini file is less than the value contained in the LastUpdate table, a SELECT statement is run against the Objects table where the value within the LastUpdate table is less than the value of the Version column in the Objects table; it also tombstones objects in the Tombstone table.

Read complete blog here


Waqas' answer and linked blog post helps explain what is going on with the File Cache, but there are a few questions left unanswered. Here is a summary.

What is the file cache?

The file cache contains xml files which represent objects in the Config database (often named SP_Config). This helps each WFE server to operate faster so that it does not have to keep requesting this data from the Config database.

What populates the file cache?

There is a timer job that is configured to run every 15 seconds by default called job-config-refresh. This populates the SharePoint file cache.

What is the cache.ini file?

The cache.ini file, in the file cache, contains a value, from the LastUpdate table in the Config database, from the Version column. This value is incremented in the Config database as objects in it are updated.

If you set this file to have a value of "1", after the file cache refresh job has run, this file should contain the same value that it contained before, unless some objects in the Config database were updated while you were deleting the file cache. You don't have to ensure it contains the same value as before - you simply have to ensure it is updated at all.

What can go wrong if this file does not exist?

There are many errors that can crop up across the system, for example "File not found" errors.

-more info required here

Why this "back up" talk?

You don't need to "back up" anything. This is superstitious nonsense. Simply delete all the xml files, and the cache.ini file, and create a new cache.ini file with a value of "1".

Tags:

Cache