Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Webserver Offline Application Cache

If you have a question or need help, this is the place to be.
Post Reply
paseant
Posts: 21
Joined: Sat Jan 26, 2008 1:06 am

Webserver Offline Application Cache

Post by paseant »

Hi,

I am trying to use the HTML 5 Offline Application Cache feature (as described in http://developer.apple.com/iphone/libra ... 51-CH4-SW1) with eventghost web server. The intended use is to store a web app that send events to eventghost locally in my phone to save load times.

So far I have not had any success with Eventghost web server. The same web site works with Abyss web server after adding the MIME type "text/cache-manifest" for associated extension "cache". If this is the problem, is it posible to add that MIME type to Eventghost web server?

If this is of any help, in http://building-iphone-apps.labs.oreilly.com/ch06.html it is said that:
You must serve the manifest file with the text/cache-mainfest content type or the browser will not recognize it. If you are using the Apache web server or a compatible web server, you can accomplish this by adding an .htaccess file to your web directory with the following line:

AddType text/cache-manifest .manifest

If the .htaccess file doesnÔÇÖt work for you, please refer to the portion of your web server documentation that pertains to MIME types. You must associate the file extension .manifest with the MIME type of text/cache-manifest. If your web site is hosted by a web hosting provider, your provider may have a control panel for your web site where you can add the appropriate MIME type. IÔÇÖll also show you an example that uses a PHP script in place of the .htaccess file a little later on in this chapter.
Thanks for any help and sorry for my english. Tell me if I can explain the issue more clearly.
User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: Webserver Offline Application Cache

Post by jinxdone »

Hi,

Replace the file EventGhost\plugins\Webserver\__init__.py with the one attached and restart EG. You can set more content types around line 190 on the __init__.py file.

I'll commit the same change to the svn later today since it seems like a useful setting to have as default.

-jinxdone
Attachments
__init__.py
Webserver plugin with content-type: text/cache-manifest supported
(11.35 KiB) Downloaded 168 times
paseant
Posts: 21
Joined: Sat Jan 26, 2008 1:06 am

Re: Webserver Offline Application Cache

Post by paseant »

Hi,

After restarting it gets some errors. I am using EventGhost 0.3.7.r1194, Vista Ultimate SP1. The log says:

Code: Select all

Traceback (most recent call last):
  File "EventGhost.pyw", line 30, in <module>
  File "C:\Program Files\EventGhost\eg\__init__.py", line 25, in <module>
    eg.RegisterPlugin(
AttributeError: 'module' object has no attribute 'RegisterPlugin'
User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: Webserver Offline Application Cache

Post by jinxdone »

Hmm.. that's odd. I just tested with Vista / EventGhost 0.3.7r1194 and it worked just fine. The modification I did was so minor I don't see how it could cause any problems.

Are you sure you have done nothing else except place the new EventGhost\plugins\Webserver\__init__.py file there? Also you can try reverting back the original file and see if you get rid of the error.
paseant
Posts: 21
Joined: Sat Jan 26, 2008 1:06 am

Re: Webserver Offline Application Cache

Post by paseant »

Sorry, my fault. I substituted the wrong file (too tired). It works perfectly now.

Thanks for your help.
arturmaj
Posts: 23
Joined: Sun Apr 19, 2009 4:55 pm

Re: Webserver Offline Application Cache

Post by arturmaj »

Paseant, can you share the code of your web page?
paseant
Posts: 21
Joined: Sat Jan 26, 2008 1:06 am

Re: Webserver Offline Application Cache

Post by paseant »

Sure. Let me some days to clean the code a bit. Now is a mess.
paseant
Posts: 21
Joined: Sat Jan 26, 2008 1:06 am

Re: Webserver Offline Application Cache

Post by paseant »

Post Reply