admin管理员组

文章数量:1323201

I'm developing Samsung smart SDK app. When executing the app its shows previous version content. (my app is running on browser and its keep displaying previous changes that i have done to the app,not the current one) After restarting the TV its shows the latest update.

This is my header.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   ".dtd">
<html xmlns="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0;   maximum-scale=1.0;user-scalable=no">

I did some changes to my Samsung TV App and it is working fine in my browser. But when paring the defects they have mentioned (from Samsung) are not in my updated version and those are from previous submitted version. I think this should be a cache. I need to ignore this and load fresh one I updated.

I'm developing Samsung smart SDK app. When executing the app its shows previous version content. (my app is running on browser and its keep displaying previous changes that i have done to the app,not the current one) After restarting the TV its shows the latest update.

This is my header.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   "http://www.w3/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0;   maximum-scale=1.0;user-scalable=no">

I did some changes to my Samsung TV App and it is working fine in my browser. But when paring the defects they have mentioned (from Samsung) are not in my updated version and those are from previous submitted version. I think this should be a cache. I need to ignore this and load fresh one I updated.

Share Improve this question edited Jul 23, 2015 at 5:41 san88 asked Jul 23, 2015 at 5:05 san88san88 1,3845 gold badges38 silver badges62 bronze badges 2
  • 1 quick solution - cache control either in the <meta> tags in the HTML page, or through headers on your http server. Without seeing ANYTHING of your code/markup, that's the most I'll say – Jaromanda X Commented Jul 23, 2015 at 5:07
  • what you describe (double reload for new code) is pletely normal and expected behavior using manifests. look into the appcache events, but honestly, it shouldn't be a problem in production if you don't push busted stuff. – dandavis Commented Jul 23, 2015 at 5:08
Add a ment  | 

3 Answers 3

Reset to default 2

In addition to the answers above you can:

  1. Reboot TV
  2. Add ?v= to the script tag for css & javascript files and change the version after every change. This process can be automated through the make system.
  3. Add no-cache headers to HTTP server, e.g. nginx:

    location ~ .*(gif|jpg|jpeg|png|ico|css|swf|js|html|htm)$ { expires 0; }
    

Try this:

localStorage.clear();

OR

var LocalStorageCache = caph.dal.LocalStorageCache;
var localstoragecache = new LocalStorageCache();

localstoragecache.clearAll();

See, if that helps.

Put this in head of your html file.

<meta http-equiv="Cache-Control" content="no-store" />

本文标签: javascriptSamsung smart TV how to clear app cacheStack Overflow