How to Force CyberPanel to Refresh Site Preview Thumbnail?

Hello everyone,

I recently fixed an error on my website, so the issue no longer appears when accessing the site normally. However, the thumbnail or preview shown by CyberPanel still displays the old version where the error was visible.

Does anyone know if there is a way to force CyberPanel to take a new snapshot, or if there is any internal process or service responsible for updating these thumbnails?

I would appreciate any guidance or experiences you can share.

Thank you in advance!
@usmannasir

After some investigation, I noticed that the preview images in the CyberPanel website list are generated using microlink.io.

According to Microlink’s official documentation, you can control how often the screenshots are refreshed by adding the ttl parameter to the URL. This parameter defines how frequently Microlink should update the image instead of serving a cached version.

After testing, the value that worked best for me is ttl=86400000, which allows the thumbnail to be updated automatically every all days.

To apply this, simply edit line 97 of the following file:

/usr/local/CyberCP/websiteFunctions/templates/websiteFunctions/listWebsites.html

And make sure the thumbnail URL looks like this:

https://api.microlink.io/?url=https://{$ web.domain $}&screenshot=true&meta=false&embed=screenshot.url&ttl=86400000

Then, restart the CyberPanel service to apply the changes:

systemctl restart lscpd

With this adjustment, the preview image will automatically refresh every all days.

@usmannasir It would be great if this parameter could be included by default in future versions of CyberPanel, so automatic thumbnail refreshing is available out of the box without the need for manual changes. This would definitely be a valuable improvement for users.

Thank you for the detailed suggestion! I’ve implemented the automatic thumbnail refresh feature you requested.

Changes Made:

  • Added ttl=86400000 parameter to the microlink.io URL in the listWebsites.html template
  • This ensures thumbnails automatically refresh every 24 hours instead of serving cached versions indefinitely

What’s New:
The microlink.io URL now includes the TTL parameter:

  https://api.microlink.io/?url=https://{domain}&screenshot=true&meta=false&embed=screenshot.url&ttl=86400000

For Current Users:
The changes have been pushed to the repository and will be available in the next CyberPanel release.

This improvement will provide users with automatically refreshed website previews without requiring manual intervention. Thanks for the valuable feedback and suggestion!

1 Like

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.