Skip to content

Generate randomly a string for clear cache from CloudFlare or other CDN. Using on Mr. Robøt.

License

Notifications You must be signed in to change notification settings

mrrobotdotapp/SuppressCache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Suppress Cache

Install it directly from the NPM registry:

npm i @mrrobotdotapp/suppresscache

This file is used on the bot for no cache files from CDNs. Discord uses CloudFlare for caching management which can be problematic when you change an image and display it on the platform. Even after a change on your side, Discord can still keep the old version in its cache.

Note

Formerly called NoCache, it has been renamed because the package name on NPM already exists.

💻 Code

const { getFolderIcons } = require('@mrrobotdotapp/suppresscache');

getFolderIcons(
  "https://mrrobot.app/Folder/Of/Icons",
  "myFileName.png",
  true,
  false
)

Give that :

[suppressCache] Output : https://mrrobot.app/Folder/Of/Icons/file.png?suppressCache=gb0cqe0j

You can test this code directly with ./test/app.js.

🎈 Awesome links

Don't hesitate to follow me, you can also contribute to the development of all projects Open Source of Mr. Robøt by making a donation.

dependency - suppressCache Twitter Follow Discord GitHub Sponsors Support me on Buy Me a Coffee