D
D
des1roer2015-01-29 13:36:49
PHP
des1roer, 2015-01-29 13:36:49

Creating a page cache for a graph?

In general, I use Highcharts .
I use ajax to get data.

$(document).ready(function(){
      $.ajax({
        type: "POST",
        url: "/convey/ajax2.php?val="+val,
        dataType: "json",
        success: function(data)
       {

in general, everything would be fine. but you need to build a lot of such graphs and there are also a lot of users. and he digs a lot. and the base began to sag. tell me how to be.
in fact, it would be logical to load the entire interval for the first time, and then get the trace of the value. but here is how to implement it. json returns a data structure of the form
[
[1147651200000,67.79],
[1147737600000,64.98],
[1147824000000,65.26],
[1147910400000,63.18]
]
how to insert data at the end of the array?
maybe there are other ways?
about highcharts if anyone is interested here
UPD
what do you mean not needed? data update every 30 seconds. about that and speech that the data from the beginning of shift was raked out by the first request, and then new ones were added once a minute. I know little (nothing) about memcache and so on. I think in the direction of cron to create a buffer file on the server and load data from it to users so as not to load the server with requests. but the question remains the same - how to
finish the
data

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Вячеслав, 2015-01-29
@hedint

Путей - куча.
Один из:
скорее всего вам не нужны актуальные данные в каждый момент - кладем результат в кэш (memcache/отдельная табличка id/data(blob/text) на минуту (или сколько вам нужно).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question