Title: mu-plugins: Reset stats cache on upload
Author: WordPress VIP Documentation
Published: August 28, 2020
Last modified: August 5, 2025

---

 1. [Changelog](https://docs.wpvip.com/changelog/)
 2. [VIP MU plugins [Production]](https://docs.wpvip.com/changelog/vip-mu-plugins-production/)
 3. mu-plugins: Reset stats cache on upload

# mu-plugins: Reset stats cache on upload

---

 28 August 2020

15:43:09 GMT+0000

 [ VIP MU plugins [Production] ](https://docs.wpvip.com/changelog/vip-mu-plugins-production/)

 [ Permalink  ](https://docs.wpvip.com/changelog/vip-mu-plugins-production/mu-plugins-reset-stats-cache-on-upload/)

We’ve pushed a fix to properly clear an internal stats cache for uploaded files.
This was causing an incorrect `filesize` value to be returned after an upload (if
done within the same request).

    ```wp-block-syntaxhighlighter-code
    wp> $file = wp_upload_bits( 'hello.txt', 'world' )['file'];
    int(5)
    wp> filesize( $file );
    int(5) <= this would previously return 0
    ```

The fix was pushed in our mu-plugins repo here:

https://github.com/Automattic/vip-go-mu-plugins/pull/1741

#mu-plugins