Microsoft Teams: How to clean cache

Posted by

If you want to clear MS Teams cache,you could refer to the following ways

1.  Fully exit the Microsoft Teams desktop client. To do this, either right click Teams from the Icon Tray and select ‘Quit’, or run Task Manager and fully kill the process.

2.  Go to File Explorer, and type in %appdata%\Microsoft\teams.

3.  Once in the directory, you’ll see a few of the following folders:

  • From ‘Application Cache’, go to Cache and delete any of the files in the Cache location. “%appdata%\Microsoft\teams\application cache\cache”
  • From ‘Blob_storage’, delete any files that are located in here if any. “%appdata%\Microsoft\teams\blob_storage”
  • Within ‘Cache’, delete all files “%appdata%\Microsoft\teams\Cache”
  • Within ‘databases’, delete all files “%appdata%\Microsoft\teams\databases”
  • Within ‘GPUCache’, delete all files “%appdata%\Microsoft\teams\GPUcache”
  • Within ‘IndexedDB’, delete the .db or .ldb file “%appdata%\Microsoft\teams\IndexedDB”
  • Within ‘Local Storage’, delete all files “%appdata%\Microsoft\teams\Local Storage”
  • Lastly, from ‘tmp’, delete any file “%appdata%\Microsoft\teams\tmp” and”%AppData%\Microsoft\Teams\Backgrounds”

For macOS, this would be the magic folder: /Users/user_name/Library/Application Support/Microsoft/Teams. (thanks to Lucian Naie (@lnaie) for the contribution)

  • Batch Version (credits to @jared)
del /F/Q/S “%APPDATA%\Microsoft\Teams\blob_storage\*”
FOR /D %%p IN (“%APPDATA%\Microsoft\Teams\blob_storage\*”) DO rmdir “%%p” /s /q
del /F/Q/S “%APPDATA%\Microsoft\Teams\cache\*”
del /F/Q/S “%APPDATA%\Microsoft\Teams\databases\*”
del /F/Q/S “%APPDATA%\Microsoft\Teams\gpucache\*”
del /F/Q/S “%APPDATA%\Microsoft\Teams\IndexedDB\*”
FOR /D %%p IN (“%APPDATA%\Microsoft\Teams\IndexedDB\*”) DO rmdir “%%p” /s /q
del /F/Q/S “%APPDATA%\Microsoft\Teams\Local Storage\*”
FOR /D %%p IN (“%APPDATA%\Microsoft\Teams\Local Storage\*”) DO rmdir “%%p” /s /q
del /F/Q/S “%APPDATA%\Microsoft\Teams\tmp\*”
del /F/Q/S “%APPDATA%\Microsoft\Teams\backgrounds\*”
  • PowerShell Version (credits to @synikil and @Salim Hurjuk)
Remove-Item –path $env:APPDATA”\Microsoft\teams\application cache\cache\*”
Remove-Item –path $env:APPDATA”\Microsoft\teams\blob_storage\*”
Remove-Item –path $env:APPDATA”\Microsoft\teams\databases\*”
Remove-Item –path $env:APPDATA”\Microsoft\teams\GPUcache\*”
Remove-Item –path $env:APPDATA”\Microsoft\teams\IndexedDB\*” -recurse
Remove-Item –path $env:APPDATA”\Microsoft\teams\Local Storage\*” -recurse
Remove-Item –path $env:APPDATA”\Microsoft\teams\tmp\*”
Remove-Item –path $env:APPDATA”\Microsoft\teams\Cache\*”
Remove-Item –path $env:APPDATA”\Microsoft\teams\backgrounds\*”
  • For CCleaner User (kudos to @Robert Franco)
[Microsoft Teams *]
LangSecRef=3021
Default=True
DetectFile=%LocalAppData%\Microsoft\Teams
FileKey1=%AppData%\Microsoft\Teams\application cache\cache|*|RECURSE
FileKey2=%AppData%\Microsoft\Teams\blob_storage|*|RECURSE
FileKey3=%AppData%\Microsoft\Teams\Cache|*|RECURSE
FileKey4=%AppData%\Microsoft\Teams\databases|*|RECURSE
FileKey5=%AppData%\Microsoft\Teams\GPUcache|*|RECURSE
FileKey6=%AppData%\Microsoft\Teams\IndexedDB|*|RECURSE
FileKey7=%AppData%\Microsoft\Teams\Local Storage|*|RECURSE
FileKey8=%AppData%\Microsoft\Teams\tmp|*|RECURSE
FileKey9=%AppData%\Microsoft\Teams\Service Worker\CacheStorage|*|REMOVESELF
;remove previous version:
FileKey10=%LocalAppData%\Microsoft\Teams\previous\|*.*|REMOVESELF
FileKey15=%AppData%\Microsoft\Teams|old_logs_*.txt

Once finally done clearing, you can now restart Teams from your local desktop and all cache will be cleared from the desktop app.

47 comments

  1. For the step:
    Within ‘IndexedDB’, delete the .db file “%appdata%\Microsoft\teams\IndexedDB”

    I could not see any .db files in that area – but instead I saw .ldb files.
    It works if the .ldb files are deleted from this section.

    Perhaps update the posting with this information.

    Like

  2. I was heavily battling with an error that I could not log in teams from the internet. I was prompted to log in, password, adn then an screen saying somehting went wrong with a missleading code caa2000c wich translates to an issue related to modern authentication.

    I was the only one in my organziation having that issue and this started a week ago.

    When I did follow your steps, they did not clean the cache 100%. I ended up deleting the complete folder %appdata%\Microsoft\Teams.

    I started Teams, toke perhaps 20 more seconds to start for the first time, I enteredmy credentials and all worked perfectly. I guess this folder is the full cache and is safe to delete. I did not had any data loss.

    Like

  3. Very helpful, saved me a lot of trouble! Do you know which directory contains files that are shared in chat? In the future I’d like to preserve the files, but wipe everything else.

    Like

  4. hi can i ask???
    i have a problem and i think have an app issues,
    i cant log in to my ms team account in my computer but my account can log in to others,
    what should i do???
    how many time that i uninstalled and installed the ms app but the problem was not fixed,
    any thought regarding to my problem???
    thanks for help in advance

    Liked by 1 person

  5. Top advice, few folders are similarly named on my PC, I just deleted the contents and sub-folders of all of them, as well as all of the files (not folders) in the Teams Folder itself – worked like a charm!

    Liked by 2 people

  6. All users have a lot of files in folder %appdata%\Microsoft\Teams\Service Worker\CacheStorage. Is it also cache? Can I delete them. What is stored in these files?

    Liked by 1 person

  7. I made some Powershell commands to copy and paste in Powershell after you exit teams. It worked for me.
    ===
    Remove-Item –path $env:APPDATA”\Microsoft\teams\application cache\cache\*”
    Remove-Item –path $env:APPDATA”\Microsoft\teams\blob_storage\*”
    Remove-Item –path $env:APPDATA”\Microsoft\teams\databases\*”
    Remove-Item –path $env:APPDATA”\Microsoft\teams\GPUcache\*”
    Remove-Item –path $env:APPDATA”\Microsoft\teams\IndexedDB\*” -recurse
    Remove-Item –path $env:APPDATA”\Microsoft\teams\Local Storage\*” -recurse
    Remove-Item –path $env:APPDATA”\Microsoft\teams\tmp\*”

    Like

  8. can someone help me with this weird teams issue
    We have migrate an organisation from Free Teams to Business Teams
    Somehow for few users signing into Desktop Teams is still picking up their Free Teams account. Whereas web version is all good.
    We have re-installed teams multiple times, it is only related to that windows profile.

    Like

    1. I would strongly recommend to clean the credential store on Windows, give it a chance. Delete the information profile on the credential store and I think that the problem would be solved

      Like

  9. Hi I followed all your steps . But could not find Application Cache folder…rest all deleted…still issue not resolved.Is there any steps i am missing to do properly.
    %appdata%\Microsoft\teams\IndexedDB folder was empty.

    Like

  10. Extremely helpful, fixed the issue I was running into with previously created Forms not loading in Teams. Thank you very much!!!

    Like

  11. this will work for login issue? because we recently integrated the user login to AD to make. and now some users are unable to login showing “we’ve run into issue”

    Like

    1. I deleted all data from Library/Application Support/Microsoft/Teams folder…but still it is loading all previous
      data

      Like

  12. I am unable to switch between Orgs in Teams. I do not get that option with a drop down to switch orgs near my profile name. Would clearing cache clear out this problem for me ? 😉

    Like

  13. Here’s a Batch version:
    ————————————-
    del /F/Q/S “%APPDATA%\Microsoft\Teams\blob_storage\*”
    FOR /D %%p IN (“%APPDATA%\Microsoft\Teams\blob_storage\*”) DO rmdir “%%p” /s /q
    del /F/Q/S “%APPDATA%\Microsoft\Teams\cache\*”
    del /F/Q/S “%APPDATA%\Microsoft\Teams\databases\*”
    del /F/Q/S “%APPDATA%\Microsoft\Teams\gpucache\*”
    del /F/Q/S “%APPDATA%\Microsoft\Teams\IndexedDB\*”
    FOR /D %%p IN (“%APPDATA%\Microsoft\Teams\IndexedDB\*”) DO rmdir “%%p” /s /q
    del /F/Q/S “%APPDATA%\Microsoft\Teams\Local Storage\*”
    FOR /D %%p IN (“%APPDATA%\Microsoft\Teams\Local Storage\*”) DO rmdir “%%p” /s /q
    del /F/Q/S “%APPDATA%\Microsoft\Teams\tmp\*”

    Liked by 1 person

  14. Hi I deleted files as per Microsoft (hadn’t found your post at the time) but now I have a folder missing and no longer have ‘Backgrounds’ as an option. I’ve tried uninstalling and reinstalling but to no avail. I used to have this option on this device so that shouldn’t be the issue but.. I am using a Microsoft Surface. Any hep would be appreciated! Naomi

    Like

  15. For all CCleaner users, you may add following lines to C:\Program Files\CCleaner\winapp2.ini:

    [Microsoft Teams *]
    LangSecRef=3021
    Default=True
    DetectFile=%LocalAppData%\Microsoft\Teams
    FileKey1=%AppData%\Microsoft\Teams\application cache\cache|*|RECURSE
    FileKey2=%AppData%\Microsoft\Teams\blob_storage|*|RECURSE
    FileKey3=%AppData%\Microsoft\Teams\Cache|*|RECURSE
    FileKey4=%AppData%\Microsoft\Teams\databases|*|RECURSE
    FileKey5=%AppData%\Microsoft\Teams\GPUcache|*|RECURSE
    FileKey6=%AppData%\Microsoft\Teams\IndexedDB|*|RECURSE
    FileKey7=%AppData%\Microsoft\Teams\Local Storage|*|RECURSE
    FileKey8=%AppData%\Microsoft\Teams\tmp|*|RECURSE
    FileKey9=%AppData%\Microsoft\Teams\Service Worker\CacheStorage|*|REMOVESELF
    ;remove previous version:
    FileKey10=%LocalAppData%\Microsoft\Teams\previous\|*.*|REMOVESELF

    Like

  16. Hi,
    All comments are about deleting the MS Teams (cache) files AFTER using Teams.
    I would like to set a limit per user/account, i.e 200 MB /user, in Teams (or Windows).
    So I can manage the diskresources better.
    We use a virtual cache disk for all (many users) and I would like to know how many TB I will need.
    Is there a setting/GPO in Teams / Office365 / Windows to set a maximum limit ?
    A diskquotum on storage level will not work, because then the system will ‘see’ a full disk and things will stop working..
    Any suggestions ? otherwise we’ve to pray for a solution in MS Teams 2.0

    Like

Leave a Reply to testingoutfordad Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s