Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

mirror II - the revenge

by Jaap (Curate)
on Feb 14, 2003 at 18:42 UTC ( [id://235366]=monkdiscuss: print w/replies, xml ) Need Help??

Commenting from the sideline is easy so after my first mirror discussion, i started working on a primitive mirror.

The result is this: Mirror

It works like this: after a request the mirror tries to load the page from cache.
  • If it has the file (no matter what the age is) it serves it promptly. It then checks the age and refreshes the cached file if it's older than 2 minutes (you are than already viewing the older doc).
  • If it doesn't have the file in cache, it loads it from perlmonks.org to cache and then serves it. This takes about 1 or 2 secs.
All form actions are routed to perlmonks.org and thus make you leave the mirror.
You may use it if you want to (it gets faster & more up-to-date when more people use it). I'd be more than happy to hear any comments.

Replies are listed 'Best First'.
Re: mirror II - the revenge
by Coruscate (Sexton) on Feb 14, 2003 at 22:11 UTC

    I just checked it out, and it seems to work fine. Going back to nodes that I have just been to indeed loads from a cache (and it's not my browser) instead of perlmonks. Now if only you could setup a cron script to do the updating automatically, but we all know that is a foolish idea and shouldn't be considered (updating all the nodes in the cache every few minutes? lol).

    One thing I will mention: merlyn has written an article that could be very useful in this sort of application. The only change you would really need to incorporate is this: set a lower time limit of when content should be re-grabbed from the perlmonks server, but where the older content is still shown. (ie: After a cached node is older than 3 minutes, show this 3-minute-old node and fork() off a process to recache the node in the background). Then, select a second, longer time limit at which content will be grabbed fresh from the perlmonks server and displayed directly to the user and cached. In this way, you will pick up a little more speed. For a more in-depth description of what I'm talking about, read that article I pointed to.


    Update: Though it's cool, does this really have a lot of use? The only thing this really does is not have to hit the server for the same node every 2 minutes. Unless lots of users started using this, it won't decrease the server load on perlmonks in any way. Even then, you simply throw the user onto the actual perlmonks site as soon as they try to submit a form. Maybe if you could send form data through your server as well. All I do around here is submit forms: login, chatterbox (unusual, but it happens), consideration of nodes, search, poll, etc etc. So it doesn't give me all that big of an advantage.


    If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, reply to this node or /msg me to tell me what is wrong with the post, so that I may update the node to the best of my ability. If you do not inform me as to why the post deserved a downvote, your vote does not have any significance and will be disregarded.

      On your update:
      You said it right. If a lot of people who only browse perlmonks.org started using this mirror/proxy, it would help.

      It not only helps perlmonks.org but also helps them since the response time is less = better.
Re: mirror II - the revenge
by Jaap (Curate) on Feb 14, 2003 at 18:57 UTC
    Additions:
    The mirror is hosted in Amsterdam, THe Netherlands (might only be fast in Europe)

    The ads are shown just like on the original site and i hope that if you click 'm they are counted as perlmonks.org clicks

    I hope there's no copyright problem or anything. If there is, i'll stop it immediately.

    I am curious whether people would really want to use this mirror or why they would not.
Re: mirror II - the revenge
by Abigail-II (Bishop) on Feb 14, 2003 at 22:34 UTC
    That's just a proxy, not a mirror, isn't it?

    Abigail

      Ehh.. you may have a point (although i don't know the real difference between them). It does look a lot like a proxy though.
        With mirrors, data is duplicated. For a read action, the other side does not have to be consulted. And write actions effect both sides, as they both need to update their data.

        A proxy is just a gateway. What you suggest is a caching proxy, but there's just one place where the data is kept, and parts of the data may be temporarily cached elsewhere.

        Abigail

Re: mirror II - the revenge
by Solo (Deacon) on Feb 15, 2003 at 01:07 UTC
    Interesting idea. It has the benefit of possibly improving performance without touching the code or asking for more from the ISP.

    On the downside, don't pages differ dramatically on a PER-USER basis? Level matters, user preferences matter, etc. This would seem to eliminate many of the performance benefits, or worse--produce incorrect results.

    --Solo

    --
    Without precise calculations we could fly right through a star or bounce too close to a supernova and that'd end your trip real quick, wouldn't it?

      You are never logged in. The proxy is an anonymous user.
Re: mirror II - the revenge
by Jaap (Curate) on Feb 15, 2003 at 00:01 UTC
    There is some strange behaviour in Internet Explorer now that i haven't figured out yet:
    It renders the top of the page, then waits a while, and then the rest.
    This would be consistent with the fact that the page is one big table which is always rendered when the </table> is found, but Mozilla renders it much faster.

    The proxy is written in Perl by the way and if anyone is interested i could post the source here.
      Laggy rendering appears to only be apparant in IE, Netscape loads just fine.

      Is logging in supposed to be available in the mirror yet? It did not work for me when I tried, and I assumed that it was not accessable yet.

      -regards

      t r e t i n

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://235366]
Approved by mojotoad
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-24 12:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found