How to completely clear the cache of the gallery on Android-smartphones Xiaomi: detailed instructions

Cache galleries on Xiaomi smartphones (including Redmi and POCO models) are temporary files that are created to speed up the download of thumbnails of photos and videos. Over time, this cache grows to several gigabytes, taking up precious space in the deviceโ€™s memory and slowing it down.

Unlike browser cache or social networks, cleaning gallery cache requires a special approach.The fact is that MIUI integrates media files with Mi Cloud services and artificial intelligence functions (for example, automatic sorting by person or place). Wrong actions can lead to loss of albums, failure of synchronization or even deletion of original photos. In this article, we will discuss 5 safe ways to clean the cache of the gallery on Xiaomi, including hidden settings and tools for experienced users.

The main reason for the cache growth is the mechanism of the Gallery app in MIUI, and each time you view photos, the system creates:

  • ๐Ÿ“ธ Miniatures (thumbnail) โ€“ reduced copies of images for quick loading in the album;
  • ๐ŸŽจ Previews for editing โ€“ temporary files with filters or cropping applied;
  • ๐Ÿ“Š Metadata โ€“ geolocation information, shooting date, camera parameters;
  • ๐Ÿค– AI files โ€“ data for the operation of facial, object and scene recognition functions (AI Scene Detection).

For example, if you open a photo in 12 MP (~4 MB), the gallery can create up to 3-4 temporary files with a total weight of up to 10-15 MB. When you use the camera actively, 1-3 GB of garbage accumulates per month, which is not removed automatically. Moreover, in MIUI 14+, the gallery cache can be duplicated in the folders.thumbnails and DCIM/.cache, which makes it difficult to find.

๐Ÿ“Š How often do you clean your Xiaomi cache?
Once a week.
Once a month
Only when memory ends
Never cleaned.

The problem is particularly acute in budget models (Redmi 9A, POCO M3) with limited storage (32-64 GB), where gallery cache can take up to 10-15% of the total space, and standard cleaning tools (such as the built-in Optimizer) often ignore these files, considering them to be โ€œsystemicโ€.

The easiest and safest method is to use the built-in MIUI tools.It is suitable for all Xiaomi models, including the Redmi Note 12, POCO X5 and older devices on the MIUI 12-14.

  1. Open the phone's Settings.
  2. Go to the Appendix section โ†’ Application management.
  3. In the search bar, type "Gallery" and select the application (image icon).
  4. Press Warehouse.
  5. Slip the โ€œClear Cacheโ€ button (not to be confused with โ€œClear Dataโ€ โ€“ this will remove all the app settings!).

Once cleaned, restart the phone. This method only deletes temporary files without affecting the original photos. However, it has a limitation: it does not clear the thumbnail cache stored in hidden folders. Additional steps will be required to completely clean (see Method 3).

Backup important photos in Mi Cloud or Google Photo|

Check the available space on the device (should be โ‰ฅ500 MB)|

Close all applications that work with media files |

Connect your phone to charge (for models with a weak battery)-->

Method 2: Using the built-in MIUI Optimizer

MIUI has its own garbage cleaner tool, the Optimizer (formerly called Security), which can find and delete unwanted files, including gallery cache, but often skips some data.

  1. Open the Optimizer app (the shield icon).
  2. Go to the Cleanup tab (or Deep Cleanup in newer versions).
  3. Wait for the scan to be completed.
  4. In the "App Cache" section, find the Gallery and tick it.
  5. Click "Clean" (in some versions - Delete).

Important: The Optimizer may show an incomplete cache volume, for example, if the actual size of the temporary gallery files is 2.3 GB, the tool can only display 1.5 GB. This is because part of the cache is system processes and is not displayed in the interface.

๐Ÿ’ก

If Optimizer doesn't find the gallery cache, try opening the Gallery app first, scrolling through a few albums, and then re-starting the scan, which will force the system to update the temporary files.

Method 3: Manually clean hidden cache folders

For advanced users who are ready to work with the file system, there is a manual cleaning method that allows you to delete all temporary files, including those that are not visible through the standard settings.

Instructions:

  1. Open the file manager and enable the display of hidden files (in Mi File Manager: โ‹ฎ โ†’ Settings โ†’ Show hidden files).
  2. Go to the root directory of internal memory (/storage/emulated/0/).
  3. Find and delete the contents of the following folders: DCIM/.thumbnails โ€“ photo thumbnails; DCIM/.cache โ€“ editing cache; Pictures/.thumbnails โ€“ thumbnails for other albums; Android/data/com.miui.gallery/cache โ€“ cache of the Gallery app.

Reboot the phone.

What to do if you canโ€™t see the.thumbnails folder?
If the file manager does not show hidden folders even after enabling the appropriate option, try: 1. Connect the phone to your PC and use Windows/macOS Explorer (hidden files are displayed by default). 2. Install an alternative manager, such as FX File Explorer or Root Explorer (the latter requires root rights). 3. Enter the path to the folder manually in the manager's address bar (for example, /storage/emulated/0/DCIM/.thumbnails).

โš ๏ธ Warning: Don't delete the.thumbnails or.cache folders themselves, just their contents! Deleting the folders can cause a gallery to crash. Also, don't touch files with the.nomedia extension, they are responsible for hiding media files from the scanner.

Method 4: Cleaning with Recovery Mode (for advanced users)

If standard methods donโ€™t work and gallery cache takes up a critical amount of space (e.g. >5GB), you can use Recovery Mode, which is suitable for root-free devices, but requires caution.

Instructions:

  1. Turn off the phone.
  2. Press the Power + Volume buttons up at the same time and hold them for 10-15 seconds until the Mi logo appears.
  3. From the Recovery menu, select the language (usually English by default).
  4. Go to the Wipe & Reset section โ†’ Wipe Cache.
  5. Confirm the action and wait for the process to be completed.
  6. Restart the device (Reboot) โ†’ Reboot to System).

This method clears the entire cache of the system, including the cache of the gallery, but does not affect user data. However, after a reboot, the first opening of applications (including the Gallery) may take longer, since the system will have to recreate temporary files.

๐Ÿ’ก

Cleaning through Recovery Mode does not delete personal photos or videos, but resets the settings of some applications (for example, saved passwords in the browser).

Method 5: Automatic cleaning with ADB (for technical users)

For those familiar with Android Debug Bridge (ADB), there is a way to clear the gallery cache through the command line, which is the most effective method, since it allows you to delete all temporary files, including those that are not visible in file managers.

Instructions:

  1. Install ADB on your computer (instructions are available on the XDA Developers website).
  2. Turn on the phone "Debugging by USB" (Settings โ†’ About Phone โ†’ MIUI version โ€“ press 7 times, then go back to Settings โ†’ Additional โ†’ For developers โ†’ Debugging by USB).
  3. Connect the phone to your PC and execute commands in the terminal: adb shell pm clear com.miui.gallery This command will reset the cache and data of the Gallery app to factory settings.

You should also disable unnecessary MIUI functions that generate additional cache:

  1. Go to Settings โ†’ Display โ†’ Animation and transitions and turn off โ€œNipature Animationโ€.
  2. In gallery settings (โ‹ฎ โ†’ Settings off "AI-albums" and "Scene Recognition".

Frequent Questions (FAQ)

Will cleaning up the cache delete my photos?
No, cache cleaning only affects temporary files (miniatures, edit previews), photos and videos remain in the DCIM and Pictures folders, but if you use the built-in gallery editor and do not save the changes, unsaved edits can disappear.
Why is the gallery running slower after cleaning the cache?
This is normal: after removing the cache, the application has to recreate thumbnails and index media files. The speed will recover after 5-10 minutes of active use. If the brakes last longer, check if the phone memory is full (should be free โ‰ฅ 1 GB).
Can I turn off the gallery cache forever?
You can't completely disable the cache, because it's necessary for the application to run quickly. However, you can reduce the volume: Use Google Photos instead of the standard gallery (the cache is optimized better there). Turn off the options in the gallery settings to Create thumbnails for video and Preload. Install MIUI without bloat (for example, xiaomi.eu), where the cache is managed more efficiently.
What if the albums are missing after cleaning the cache?
Chances are, the problem isn't the cache, it's the gallery database crash. Try: Reboot your phone. Open the gallery and wait for the re-indexing (may take up to 10 minutes). If the albums don't show up, check the DCIM folder through the file manager -- maybe the files are in place, but the gallery doesn't see them. In extreme cases, reset the gallery settings via ADB (see Method 5), but note that this will delete all user settings.
How to clear the cache of the gallery on Xiaomi without access to the phone (for example, if the screen is broken)?
If the phone doesn't respond to touch but turns on, plug it into your PC and use ADB (see Method 5). If the screen doesn't work completely: Connect your phone to your PC via USB-OTG and mouse (if supported). Use Mi PC Suite for remote control (the feature isn't available on all models). In a pinch, remove the memory card (if photos are stored on it) and clear the cache through another phone or PC. For devices with an unlocked bootloader, you can flash TWRP Recovery and clear the cache through it.