Open Mohammad-Ravand opened 7 months ago
every time i have resource to download a gain
You should check the headers on your server. Pannellum loads the images using standard XHR, and caching is handled by the browser, not Pannellum.
i try to load image with new Image() in javascript and after this loaded add image to pannellum.viewer()
This doesn't accomplish anything. If you have caching properly configured, this isn't necessary, e.g., the examples on pannellum.org load from cache without issue. If you still want to do something like this, you need to use createImageBitmap
to convert the Image
to an ImageBitmap
and pass that to Pannellum instead of the URL.
Thank you very much for your reply, I will definitely try it.
i am using react , i have component name ShowImage360Degree, this component show one image in panorama and when user click on close button, this component will destroyed, at first time pannellum for get image sent xhr request to get image from server, for second time this will happend a gain, i want cache image at first time and using a gain without sending request to server for subsequent times,
i try to load image with new Image() in javascript and after this loaded add image to pannellum.viewer() but not working , every time i have resource to download a gain.
this is my code: