"Autorefresh" Feature In The Website.

Recently I noticed an "autorefresh" feature in a website. In this website there is no real time chat or anything. Just simple links to latest news,technical reviews, Technical Q/A & Technology debates.

After every 10 minutes this website refreshes automatically, even we don't hit on "refresh" button.
So, if url is like : #-Link-Snipped-# then it changes something into #-Link-Snipped-# .

This is very nice feature. Anyone knows how it's done ? (this is just for knowledge purpose, I aint developing a website)
This is the first website I have seen with such feature, anyone knows the reason why this feature is not widely used ?

Any idea ? Would like to know about this in detail.

A one more dumb question : In Website like "twitter", the feeds are updated automatically. While in the CE we gotta refresh to see if any update has happened or not. While in the above mentioned website, the feeds are refreshed every 10 minutes. How all these features are added ?
Waiting impatiently to know this. #Curious.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • [Prototype]

    @prototype-G9Gn5k Jul 6, 2013

    Twitter and other websites uses AJAX. Refreshing the complete page takes more time which is the motivation behind AJAX. Using AJAX, you can just refresh a part of webpage which actually needs an update instead of refreshing the complete page.

    The mechanism you're talking is pretty old and slow, replaced by the above one. There are many ways of doing it, simplest is using HTML as shown below.

    <meta http-equiv=”refresh” content=”5; URL=https://CURRENT_PAGE_URL”>



    That "5" basically indicates the time period between refresh, in seconds.

  • Kaustubh Katdare

    @thebigk Jul 6, 2013

    A lot of websites do that to increase the pageviews. TimesOfIndia uses slideshows for content so that each new slide adds to an extra pageview.

  • Abhishek Rawal

    @abhishek-fg9tRh Jul 6, 2013

    #-Link-Snipped-# Thanks for information,mate. One more question : Is there any condition for that ? What I mean, is there any criteria required to have such feature, or any website written with any language can add that feature (I mean automatic refresh using AJAX)

    #-Link-Snipped-# Why don't CE have that feature ? Is there any technica lreason behind that ?

  • Kaustubh Katdare

    @thebigk Jul 6, 2013

    There's no use in refreshing the page. There are better, modern techniques powered by AJAX. We actually cut-down on the page-refreshes (affected our revenues directly 😕 ). In earlier version of CE, posting a reply would lead to a page refresh. Post a comment on provide would result in a new page refresh.

  • Abhishek Rawal

    @abhishek-fg9tRh Jul 6, 2013

    Kaustubh KatdareWe actually cut-down on the page-refreshes (affected our revenues directly 😕 )

    How does page-refreshes affects the revenue ? 😨
    Elaborate please.

  • Kaustubh Katdare

    @thebigk Jul 6, 2013

    The simple math is more the pageviews, more is the revenue.

  • Anil Jain

    @CrazyBoy Jul 6, 2013

    AJAX was developed to reduce the server load.
    As you mentioned that you have observed the other website auto refreshes itself after every 10 minutes. I am just assuming that they wants to refresh a particular section of the website (NOT ALL THE CONTENTS), but they choose the rather easier implementation of auto refresh. However their implementation would lead to greater server load and network consumption to user as each refresh request will use network and will request / response from server.

    However in AJAX, this is a technology where screen is divided in frames and sections. Only relevant section of the website is refreshed not all. That will reduce the load.

    In today's world most of the website are using AJAX for development.

    Also the auto -refresh, I believe many wbesites (especially new websites) uses that.

    -CB

  • Neeraj Sharma

    @neeraj-iAaNcG Jul 6, 2013

    I have encountered auto refresh in a lot of company's intranet websites where development or log views take place. Never noticed it in any other website over internet. The sole purpose of auto refresh should be when we are monitoring a progressive activity over a web page, the best example being logs of an operation.

  • Manish Goyal

    @manish-r2Hoep Jul 6, 2013

    I guess node.js can answer your questions, which i believe is preferable to ajax when it comes to real time interaction with servers


    Reason : Say I have a application that loads latest news in a particular section of my website, then if i choose ajax, then what i will do simply make a ajax call after a regular interval of 10 sec (say) and load latest news, but this in turn increases server load

    So here comes the use of node.js, which simply sends information to client side script that something new has been arrived

    In short node.js is something that can communicate with server directly instead of any server side language like php as intermediator

    Thanks

  • micheal john

    @micheal-john-l1fIn3 Jan 15, 2014

    Manish GoyalI guess node.js can answer your questions, which i believe is preferable to ajax when it comes to real time interaction with servers


    Reason : Say I have a application that loads latest news in a particular section of my website, then if i choose ajax, then what i will do simply make a ajax call after a regular interval of 10 sec (say) and load latest news, but this in turn increases server load

    So here comes the use of node.js, which simply sends information to client side script that something new has been arrived

    In short node.js is something that can communicate with server directly instead of any server side language like php as intermediator

    Thanks

    Hi @#-Link-Snipped-# , i'm new to node.js can you refer any source or books for learning node.js please.

  • Manish Goyal

    @manish-r2Hoep Jan 15, 2014

    Truly speaking I never learn anything from books

    Just Google about node.js tutorials, there you will find a number of tutorials

    Also while reading tutorials

    Try to implement steps practically, that will give you a more clear idea of node.js

    2: You must have basic knowledge of ajax while learning node.js

    If you have any specific query while implementing it, feel free to ask

    Thanks

  • Nirmal Parwate

    @nirmal-parwate-2C4etN Jan 16, 2014

    A simple way to do auto-refresh would be using a setTimeout function which calls another function which makes an ajax call and on success of that ajax call, the response can be used to refresh any particular DOM element in the page. At the end of the you called function you can call your first function again which makes it recurring. In the following example you just have to call time and it will work till it calls itself 10 times.

    Example:

    function time(i) {
        setTimeout (
            function() {
                console.log('abc '+i);
                if(i<10) {
                    time(++i);
                } else {
                    console.log('finished recurring function');
                }
            }, 1000);
    }
    
    time(0);
  • Nirmal Parwate

    @nirmal-parwate-2C4etN Jan 16, 2014

    This note is to the admin/developer of CE you should provide edit functionality to the person who wrote a reply...

  • Kaustubh Katdare

    @thebigk Jan 16, 2014

    Nirmal ParwateThis note is to the admin/developer of CE you should provide edit functionality to the person who wrote a reply...

    The new registrations aren't allowed to edit their posts for a reason - they would register, make a regular post, log-in after a few days and add spammy links to their posts.

    PS: You should see the permissions on your account pretty soon.

  • Nirmal Parwate

    @nirmal-parwate-2C4etN Jan 16, 2014

    Kaustubh KatdareThe new registrations aren't allowed to edit their posts for a reason - they would register, make a regular post, log-in after a few days and add spammy links to their posts.

    PS: You should see the permissions on your account pretty soon.

    Okies, i'll check that.. Thanks

  • Nirmal Parwate

    @nirmal-parwate-2C4etN Jan 16, 2014

    Does an AJAX call affects revenues or it happens only on page refresh??

  • Kaustubh Katdare

    @thebigk Jan 16, 2014

    Nirmal ParwateDoes an AJAX call affects revenues or it happens only on page refresh??

    Yes it does; for the ads that rely on pageviews.

  • simplycoder

    @simplycoder-NsBEdD Oct 24, 2014

    SignalR is also amazing in this context.
    One might take a look #-Link-Snipped-#

  • Agha Abdul Rahman

    @agha-abdul-rahman-UuAZ34 Oct 24, 2014

    Abhishek RawalRecently I noticed an "autorefresh" feature in a website.

    Great ! thanx bro, you have solved some problems.

  • avii

    @avii-TGGs8o Oct 26, 2014

    so much wrong info being shared here. Twitter or any top site like Facebook, does not use AJAX or timeout refreshes. They use web sockets. For HTML5, <a href="https://www.w3.org/TR/2014/WD-push-api-20141007/#example" target="_blank" rel="nofollow noopener noreferrer">Push API</a> is being 'pushed'.

    DON'T USE AJAX FOR THIS KINDA SHIT. THAT'S JUST HORRIBLY WRONG.