2

I administrate a website which gets many hits per day, these vary hour by hour and across the various areas of the website. This website is 'white labeled' and sold to clients.

I am creating a set of reporting tools which will allow clients to understand how their users are using their site.

I can create some 'standard' analytics, whereby user data is saved to the database and this same data is shown when clients visit the analytics page, but what I want to do is show live data which updates live as my clients view their analytics page.

I know Google Analytics offers something similar, however it would not suit my problem (the above description is an oversimplification of the actual problem...) yet I am trying to do something similiar.

I don't really want to poll the database using AJAX every few ms. Can anyone offer an better solution to updating my page regularly with new data.

Ideally I am looking for a javascript and or PHP solution. Thanks

4

1 回答 1

0

If you want to update your page regularly with freshly collected data then AJAX is what you need my friend. Sorry. If you're worried about the number of AJAX calls, you can update less frequently (every minute) or even put in a refresh button.

Dodgy alternative: If it's for metrics that increase reasonably stably and don't need to be exact, I suppose you could take the speed it increases and dummy that with Javascript. An example of this is the gmail log in page:

Over 10244.816596 megabytes (and counting) of free storage
于 2012-05-09T11:04:35.130 回答