offline.appcache problem

Discussion and feedback on Construct 2

Post » Thu Aug 01, 2013 3:21 pm

I have a real problem, and can't work it out.

By default, the C2 mobile project uses the offline.appcache feature which is supported by many browsers.

The problem is, once we have uplaoded one version,then delete the files and upload a new version of the game, we can only ever see the old version.

Getting the new version is proving to be a very difficult job.

In Safari on ihpone 4, ios 6, it never seens the new version, no matter how much refreshing you do.

Same with chrome on desktop, once you have an old version loaded, you wont get a new one.

but IE 10, always sees the new version.

I thought it was the apache web server caching the offline.appcache, but this doesnt seem to be the case. When My local chrome goes to the sites URL, using Charles proxy, I can see it gets the full and correct offline.appche, but kinds of ignores it. After it has read it once, the sever just sends 304 (not modified) response, which is correct.

In our office, we have one person with windows 7 who always sees the new version in all 4 browsers (IE, FF, Opera and chrome). We have another person who only ever sees the old version, which includes myself. so its not the ISP. In the office we have no proxy or caching.

On chrome, you dont seee the new version even if you "Empty the cache" from the tools menu, then go to the site again. you have to do this:

1) go to this URL: chrome://appcache-internals/
2) Find the site.
3) hit the remove button.
4) "empty the cache" in tools.
5) now when you go to the site, you will see the new version.

Safari on mobile is similar, requireing every user to go into settings->safari->Clear cookies and data.

We cant expect all our customers to do this each time, and have to mail them to tell them there is a new version.

On apache, I added this in the .htaccess:

AddType text/cache-manifest .appcache

If I modify any file on the Apache web server, then request it again, I seem to always get the latest version. The hosting company says they don't do any explicit caching in Apache.

But I think this was redundant, as the mime time which Apache is returning was that already.

If I run IIS locally, and deploy to that, I dont get the issue in Chrome or safari.

Any ideas? Anyone else with the same issue?

I cant tell if its a problem with:
1) the local PC
2) the ISP
3) C2
4) windows chrome & safari on ios6
5) Apache.
B
17
S
6
G
3
Posts: 370
Reputation: 3,942

Post » Thu Aug 01, 2013 5:24 pm

In Chrome, try to force refresh (Shift + Ctrl + F5) several times in a row to see if the changes become effective.

From what you explained, I'd suspect an issue with your hosting service/ISP or maybe your NAT/network parameters since when you host locally, browsers have no issues.
You don't tell what is the OS of the people who have issues seeing the new versions. This may be something to look into too.

Also are you sure when you update your file that you follow the process indicated in that tutorial ? (uploading again/overwriting the old offline.appcache)
You might want to check out if the issue is there with the mentioned event "Is downloading update". Do a debug version in which you display the value of this file to see if the target client is "aware"/downloading the newest version.
If it is not, it might indicate the newest version isn't "recognized".

I hope this helps.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,795

Post » Thu Aug 01, 2013 6:00 pm

@Kyatric, I can confirm that:
1) I export the entire project each time, delete all the old files on the web server, and upload all the exported files each time.
2) I don't modify in any way any file between exporting and uploading to server.
3) I always upload all files.
4) the web server is correctly setting the mime type to text/cache-manifest when I want it in Charles Proxy.
5) repeated Shift+F5, Ctrl+F5, F5, Ctrl+Shift+F5 etc. has no effect.
6) test.nektan.com/test I have uploaded a project with a slingle layout with a single number. On my browser it is 4, but I have updated it several times to 7 I think. Chrome (and safari on ios) are stuck on 4. any new person will see the new version (7 or so). The only way i can get chrome to go from 4 to 7, is do do that thing with chrome://appcache-internals/
7) It doesnt appear to be the network, as if I request the offline.appcache, http://test.nektan.com/test/offline.appcache I see the correct file with the correct mimetype, content etc. But Im not 100% sure what the header should look like.
B
17
S
6
G
3
Posts: 370
Reputation: 3,942

Post » Thu Aug 01, 2013 6:03 pm

This is the offline.appchache


CACHE MANIFEST
#1375349555
index.html
c2runtime.js
jquery-2.0.0.min.js
icon-16.png
icon-32.png
icon-114.png
icon-128.png
loading-logo.png
NETWORK:
*
nutmix2013-08-01 18:04:04
B
17
S
6
G
3
Posts: 370
Reputation: 3,942

Post » Thu Aug 01, 2013 6:10 pm

I have the same problem. I never solved it properly. I just removed the offline.appcache for development. Now it doesn't do it any more, but now I don't get the benefit of offline :\
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Thu Aug 01, 2013 6:26 pm

Interestingly, this is the response from the web server when Chrome requests the file:

HTTP/1.1 304 Not Modified
Date     Thu, 01 Aug 2013 17:13:01 GMT
Server     Apache
Connection     close
ETag     "5a149e9-402-4e2e5ccdd308a"

The server is in a different time zone. The server and client clocks are correct.

I last updated the file at 19:12 GMT+2 (which FTP shows correctly as the timezone adjusted modification time)

When I ran this it was 19:15 in Gibraltar, which was 18:15 in UK, which in summer is 17:15 GMT or UTC.

This was the request:

GET /bingo/offline.appcache HTTP/1.1
Host     test.nektan.com
Connection     keep-alive
If-Modified-Since     Thu, 01 Aug 2013 17:01:59 GMT
If-None-Match     "5a149e9-402-4e2e5ccdd308a"
User-Agent     Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36
Accept-Encoding     gzip,deflate,sdch
Accept-Language     en-US,en;q=0.8

The crux is that apache is returning the 403 response incorrectly for a file which was just modified. This would appear to be a bug in Apache (which is unlikely) or other time zone related issue?nutmix2013-08-01 19:02:08
B
17
S
6
G
3
Posts: 370
Reputation: 3,942

Post » Thu Aug 01, 2013 6:28 pm

How can I stop C2 generating the offline.appcache? When I get a final version, ill add it back, and pray I dont need to patch it.
B
17
S
6
G
3
Posts: 370
Reputation: 3,942

Post » Thu Aug 01, 2013 8:30 pm

I never got C2 to stop generating the file. I had to remove the file manually. Each time.

But those are some really good finds you have there. This is certainly a developer problem for teams. I hope your insight will help track down a simple solution.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Sun Apr 20, 2014 11:14 am

If you want to modify the html that is exported from C2 open up the html that you'll be using in

C:\Program Files\Construct 2\exporters\html5\templates

For example, the normal HTML5 with Full Screen turned on is export-fs.html.

You can remove the cache manifest reference from the top of the html.

Hope that helps! The caching drives me nutssss when not working on full release versions...
B
8
S
2
Posts: 17
Reputation: 1,484


Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 20 guests