Caching a web page from account

Status
Not open for further replies.

N Soong

New Member
Messages
3
Reaction score
0
Points
1
Hello everyone! I'd just like to start by apologizing if this question seems to have an obvious answer, but as a noob to this sort of thing I really need help. What I've done is created a little web app that I'm hosting from my account. A very important feature is for this app to cache itself so it can be accessed offline. I have added the reference to the manifest file in the html file and also written out a manifest file (with the extension '.manifest'). I've currently got this manifest file in the directory '.cpanel\caches\' I know there's something I need to do with the .htaccess file but I haven't been able to find it, nor enable the 'show hidden files' option (I can't find that either!) Just for your info, this is a free account that I'm running. Basically I'd like to know what exactly I need to do to get the cache working ie what files I need to tweak and where to put the manifest file.

Thanks very much in advance and apologies for the noobish question :D
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Your users will have to access your manifest file to create the offline (local) version of your app, and they can't get at anything outside of your public_html directory. You can place files just about anywhere in your account and include their content on web-accessible pages, but there is no way (over HTTP) for anyone to get directly at anything outside of public_html.

As for the .htaccess, ideally you'd want to create a MIME-type definition for the .manifest file type, but it's not actually necessary; it simply tells the server to send a specific MIME-type file header along with the file so the browser knows it's a manifest file (which you're already telling it using the meta tag).
 

N Soong

New Member
Messages
3
Reaction score
0
Points
1
Your users will have to access your manifest file to create the offline (local) version of your app, and they can't get at anything outside of your public_html directory. You can place files just about anywhere in your account and include their content on web-accessible pages, but there is no way (over HTTP) for anyone to get directly at anything outside of public_html.

So I need to put the manifest file in the public directory? Is there anything I need to do other than that?

As for the .htaccess, ideally you'd want to create a MIME-type definition for the .manifest file type, but it's not actually necessary; it simply tells the server to send a specific MIME-type file header along with the file so the browser knows it's a manifest file (which you're already telling it using the meta tag).
So I can just leave the manifest file alone and it should work?

Thanks so much for your help thus far!
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Other than placing it in a public directory, just make sure that the URL you include on your app page(s) is correct. And yes, you should be able to just leave the file as-is - but test in all of the browsers that you want to support. If you find you need to add the MIME-type to .htaccess, it's a simple one-liner, and if you need help with that you can post back to the "Scripts, 3rd Party Apps and Programming" forum here.
 
Status
Not open for further replies.
Top