Slow update of data and image loading

Hi @snowformatics,

Try setting the ttl value using timedelta, e.g. ttl=datetime.timedelta(hours=24):

@st.cache_data(ttl=datetime.timedelta(hours=24))
def load_data(nrows):
    data = pd.read_csv(DATA_URL, delimiter='\t', dtype={'time':str})
    data['date'] = data["timestemp"].str.slice(stop=10)
    data['date'] = pd.to_datetime(data['date'], format=f)
    data['time'] = pd.to_datetime(data['time'], format=f2)
    data['date'] = data['date'].astype(str)
    data['time'] = data['time'].astype(str)
    data['time'] = data['time'].str.slice(10)

    data[DATE_COLUMN] = pd.to_datetime(data['date'].astype(str) +
                                          data['time'].astype(str))

    return data

Let me know if you see any significant improvement in image loading by reducing the res.

You should also consider optimizing the dataframe operations in this part of your code;

for index, row in data2.iterrows():
    id_all = row['image_file'][0:25]
    for index1, row1 in top_meteors.iterrows():
        id_top5 = row1['url'].split('/')[4][0:25]
        if id_all == id_top5:
            if id_top5 not in top_meteor_list:
                top_meteor_list.append(id_top5)
                st.image(row1['url'],width=600)

The nested loop can also be optimized to run much faster.