1

I am trying Alfresco share Community Edition. It has a discussion site where user can ask questions. The problem here is alfresco does not provide auto refresh out of the box. The user has to refresh the page continuously to find that someone is replying to his post or not.

I learned that JavaScript can be used to auto reload the page.

  1. Is auto refresh done in client side or in my webapp server?
  2. Will auto refresh burden my webapp so when more than 150 members are logged in and auto refresh happens will it become unresponsive?
1

The user has to refresh the page continuously to find that someone is replying to his post or not. I learned that JavaScript can be used to auto reload the page. Is auto refresh done in client side or in my webapp server?

Reloading a website is always initiated by the client.

All the server does is accept a request for data, check the disk for the required data, execute any necessary script processing programs, then send the result back to the client. Depending on server power, and how many people are using it for any purpose (including email, etc), this process takes normally between 100ms and about 2 seconds. Anything more than 200ms is a disaster.

Having said all that, The best way to solve your auto-refresh problem is by using javascript. What you want to do is set an automatic timer with Javascript's own timeout function and every so often, make a page that generates content load using AJAX technology (advanced java and XML). Just make sure you don't set the frequency of calling the small page too high or you'll place a burden on your app.

For the page, it will have to be a dynamic script (like php), not a simple html page. What it will do is only spit out the new text then in javascript you append it on to the existing text that is already on screen.

You might find examples of this in Jquery code which is supposed to be an easier-to-use javascript made in javascript.

Another alternative is to go old fashioned and make the live messages appear in an IFrame but have the static content appear outside the IFrame, but if you do that, then the html code in the IFrame must include an auto-refresh which can be achieved via meta tags or javascript.

Will auto refresh burden my webapp so when more than 150 members are logged in and auto refresh happens will it become unresponsive?

It will likely be unresponsive if it refreshes too fast. It will also be unresponsive if the server is unhealthy (for example, it has been hacked into).

1
  • 2
    My heart stopped beating when you claimed that AJAX stands for "Advanced Java and XML".
    – Lie Ryan
    Jun 3 '16 at 5:18
0

Auto refresh is triggered client side and it causes the client to refresh additional information from the server.

It will request additional information from your server that your server will have to be beefy enough to handle. How many users your server can handle with auto refresh depends on many factors:

  • How powerful your server is
  • How frequently the refresh happens
  • How efficient the code is that powers your website
  • How much is refreshed (is it the whole page, or just a portion?)

You may find that auto refreshing can be implemented in such a way that it puts less burden on your server than users constantly banging on the refresh button. This site uses Websockets to efficiently notify the page that there are changes that have happened.

0

Useful feature, but doing a hard browser refresh is the wrong way to do it. Users will hate you and quit in droves (which will, at least, solve the server-load issue.) It's done on browser side with Javascript and timers, but like I say... don't.

Sites that do it well use stuff like AJAX to poll the server and rewrite parts of the page as needed. That is not simple. I'd bet someone has already written something like this for your platform, no need to reinvent the wheel. If not, look at other platforms, because if they can't do that...

0

You can use another technique. Its is web-socket service( example -firebase) to share changes. This will help to minimize request and need of reloading.

If need more details,reply on same thread so we can add more points(detailed explanation)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.