Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Option to disable cache (localStorage) #88

Open
renegadevi opened this issue Jun 24, 2023 · 4 comments
Open

[Feature Request] Option to disable cache (localStorage) #88

renegadevi opened this issue Jun 24, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@renegadevi
Copy link

Iconify by default has cache enabled, this is good for performance but because it uses localStorage, it's something that may not always be initially wanted. As for Iconify, it creates more entries the more icons you use.

Skärmavbild 2023-06-24 kl  18 18 42

Iconify has a built-in function to disable this, but I cannot find any way to disable it with this module, such as in module options in the nuxtIcon-config which would had been very useful.
https://iconify.design/docs/iconify-icon/disable-cache.html

By default, localStorage is enabled, sessionStorage is disabled.

@Atinux
Copy link
Contributor

Atinux commented Jun 30, 2023

Do you want to disable it in development only @renegadevi ?

Because it production this can lead to serious performance drawbacks.

@renegadevi
Copy link
Author

renegadevi commented Jun 30, 2023

Do you want to disable it in development only @renegadevi ?

Yes this is mainly during development or testing.

@Atinux
Copy link
Contributor

Atinux commented Aug 7, 2023

Have you try adding a plugin to do it @renegadevi

// plugins/iconify.ts
import { disableCache } from 'iconify-icon';

export default defineNuxtPlugin(() => {
  if (process.dev) {
    disableCache('all')
  }
})

@Atinux Atinux added the enhancement New feature or request label Aug 7, 2023
@renegadevi
Copy link
Author

Sadly not. I tried it with the nuxt-icons and just standalone iconify-icons, both still cached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants