Addon file caching (files in storage/tmp)

Hi everyone!

Does anyone have any insights on how addon caching works?

I installed a custom addon which works fine but when I quickly wanted to change something in the .tag-file the changes didn’t show up in the UI.

After some digging I found parts of the custom tag in storage/tmp/14ac1d4f21cb0042eca0caab225d4581.js. My question is if it is safe to delete this file or if there is another way to tell Cockpit to re-read my .tag-file?

Thanks in advance!

If you turn debug mode on, then assets get a timestamp suffix to prevent browser caching and the js caching mechanism will be ignored.

To enable debug mode, change your config/config.php to

return [
    'debug' => true,
    // other options...

If your host is localhost, debug is on by default if not disabled via config file.

If the .tag file extension isn’t .js, it shouldn’t end up in the js cache… Did you try to disable caching in your browser dev tools (in Firefox in the network tab, should be similar in chrome)?

I guess, that the addon overwrote a core component, which are stored in modules/Cockpit/assets/components.js, so the core components are in the cached js file.

You can delete everything inside storage/tmp. It will be regenerated, if needed.
You might want to keep .gitignore and index.html in this directory. So don’t delete these files.

assets timestamp:

cache for js assets:

auto debug on localhost:

Thanks for your reply! The debug mode did the trick.

I used your field-tags-autoupdate which I assume overwrote the regular tags.

Thanks again for all the awesome Cockpit Addons and the great Cockpit support you provide!

I see. It doesn’t overwrite the core tag field, but the whole code is based on the core field.

I didn’t update this modified field for a while. Have a look at the changes to the core field, so the limit option is not available and the keycode for , (comma) is hardcoded, which fails for some keyboard layouts (e. g. Russian).

Feel free to update it and send a pull request if you need the changes or if you want to provide them to future users.