<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cache_add(self, resource_url, cache_id):
 """Add entry permanently to local cache. Parameters resource_url : string Resource Url cache_id : string Unique cache identifier for resource """

        # Add entry to cache index
        self.cache[resource_url] = cache_id
        # Write cache index content to database file
        with open(self.db_file, 'w') as f:
            for resource in self.cache:
                f.write(resource + '\t' + self.cache[resource] + '\n')