It is Based on the file saved in a disk.Using cache dependency, we can force ASP.NET to expire cached data items from the cache when the dependency filechanges. We can set the dependency to multiple files also. It is Based on the file saved in a disk. On such cases, the dependency should be built from an array of files or directories.
File-based dependency facilitates you to save the dependency on a file in a disk.
A key-based dependency lets us know when a particular cache item is invalidated or updated when another cache item changes. This is useful when we have multiple interrelated objects in the cache and if one of the objects changes, we need to update or expire all of them.
In key-based dependency, you depend on another cached item.