简体   繁体   English

Google Earth插件-fetchKML()-如何清除缓存?

[英]Google Earth plugin - fetchKML() - How to purge cache?

I have a very similar scenario to the one described in 我有一个非常类似的场景,其中描述

Note: My KML file is fetched every single second. 注意:我的KML文件每秒提取一次。 The KML file size is ~1 MB. KML文件大小为〜1 MB。

When getting the KML updates the url is changed as suggested in the aforementioned thread. 在获取KML更新时,网址会按照上述线程中的建议进行更改。

var url = 'test.kml?rnd='+Math.random();

This works perfectly. 这很完美。 On the other hand, it causes the geplugin.exe process to consume more and more memory, which leads to a crash of the plugin. 另一方面,它会导致geplugin.exe进程消耗越来越多的内存,从而导致插件崩溃。

Does anyone run into the same issue? 有人遇到同样的问题吗? Is there a way to force GE Plugin to purge the cache? 有没有办法强制GE插件清除缓存?

Is there a way to force GE Plugin to purge the cache? 有没有办法强制GE插件清除缓存?

AFAIK there isn't any way to clear the cache from javascript or the API. AFAIK没有任何方法可以从javascript或API中清除缓存。

My KML file is fetched every single second. 我的KML文件每秒提取一次。 The KML file size is ~1 MB. KML文件大小为〜1 MB。

Fetching a circa 1 MB kml file every second smells. 每秒钟获取大约1 MB kml文件的气味。 How are you calling fetchKml every second and adding the data to the plugin? 您如何每秒调用fetchKml并将数据添加到插件?

Without actually seeing your code it is impossible to say what is actually happening but this sounds like the root of the problem. 如果没有真正看到您的代码,就无法说出实际发生了什么,但这听起来像是问题的根源。

On the other hand, it causes the geplugin.exe process to consume more and more memory, which leads to a crash of the plugin. 另一方面,它会导致geplugin.exe进程消耗越来越多的内存,从而导致插件崩溃。

It sounds as if you are creating some objects inside a tight, never ending, loop. 听起来好像是在紧密而永无止境的循环中创建一些对象。 Running out of memory would be expected in this case. 在这种情况下,可能会耗尽内存。

You should probably be using Networklinks to load the kml data rather than fetchKml, but again, without seeing your code it is impossible to say. 您可能应该使用Networklinks而不是fetchKml来加载kml数据,但是同样,如果看不到您的代码,就很难说了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM