Construct unique URL to prevent caching

Flmngr.getNoCacheUrl
( url: string ): string

Adds a no-cache parameter to the end of the URL with a value of the current timestamp in milliseconds. This is useful when you've edited a file in the image editor and now want to force your app to refresh it. There is no way to instruct the browser to a specific URL without refreshing the page, so this method can be helpful. After you save inserted image you can remove the such parameter from the URL, but this is up to you.

If you pass a URL with the no-cache parameter to a Flmngr method like Flmngr.open({params}), the no-cache parameter will be automatically removed from the URL, so you do not need to handle this manually. Keep in mind this when passing such URLs to any method of the Flmngr file manager API.

Note: This method will not generate a URL that forces every browser of a user/visitor to request the image every time. It will only force each browser to update the image to this version and the standard caching policies on your website will take effect.

Parameters

  • url

    :
    string

    A URL for which you wish to retrieve the no-cache version.