On May 24, 2012, at 03:47, thuan le minh wrote:

> i want to cache a web page to view it offline
> examle :
> - the first : i can access the website http://nodejs.org as you see
> 
> -  and then : the web server may be dead so if i try to enter the url
> http://nodejs.org on my web browser i can'nt access this website . A
> notification will be appeared : "Server not found .." or etc..
> 
> - so i still want to access nodejs.org website and view content of it
> in my local . i can enter the url http://localhost:6666 to see content
> of nodejs offline
> 
> so , how can i do ??

You've asked this question several times already but it sounds like a fairly 
straightforward programming task.

I have a 200-line PHP script I wrote seven years ago that does this. There was 
a local directory where I saved every page's content and headers. For each 
request, it took the path of the URL and tacked it on to the hostname I was 
mirroring and performed a cURL request to see if the remote file was newer than 
the cache file it already had. If so, or if it didn't already have a cache file 
for that URL, it downloaded it. Finally, it displayed the content of the cached 
file.

I'm sure it could be done more nicely in node.js. What exactly do you need our 
help with? What have you got so far?



-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to