html timetable should expire immediately (no cache)

Started by math_user, September 13, 2016, 05:03:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

math_user

There is sometimes the problem that the html timetable does not display the newest version (on the server) when I have viewed the old version before.
Would it be possible to include a "no cache" instruction so that the html document is re-downloaded every time you access it (on a server)?

Volker Dirr

do you talk about a webbrowser that is never restarted (maybe a computer in the teacher room)?
hmm... i think to care about our planet earth it is better to turn the computer off over night. so i don't think i need to add a reload there, since in normal case a timetable is valide several weeks.

or do you talk about a webbrowser that is restarted?
i could force it. but i am not sure about the time. if i choose it to high, then it won't help you. if i choose it to low, then it contradict the sence of an cache. in titito it will be easy: i can just set the end time of the timetable that is set by the user.
but what time do you suggest?
(it can be added by a html meta tag (http-equiv="expires"))

math_user

Thanks, Volker!

When I close my browser, the cache is cleared. The problem occurs when I view the old timetable (over the internet), upload the new version to the server and then view the new timetable (without closing the browser). As this might also happen to other people who need to book rooms in our system, I would appreciate a html meta tag (http-equiv="expires").

Quotebut what time do you suggest?
What about half an hour? So you can switch between groups and rooms without reloading. But when you access the next time, you have to reload.

I would need to add the meta tag in each html-file (groups, rooms, ...), correct? What would be the correct line to add, so that I can test this?
<meta http-equiv="expires" content="1800">
Would that work?

So the html-files would start as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
  <head>
    <title>...</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="expires" content="1800">


Thanks for your help!

Volker Dirr

#3
ah... you always generate again for your booking system. so your booking system generates a fet file and you generate that file with fet again? intresting. maybe let us know you booking system.

yes. you need to add it in every html file. the line looks fine. please test and let me know.

don't forget, that the "expires" doesn't reload itself. the user need to open and close the webbrowser (or press the reload button).

you might also think about forceing reloading, but that will probably do big traffic on your server.

math_user

Thanks for your answer, Volker!

Unfortunately, the transfer between FET and our booking system (Evento) does not (yet) work automatically. The administration enters the data manually ... Maybe out IT will build a tool that reads FET data and converts it to the Evento format.

I might test a combination of "expires" and "reload":
<meta http-equiv="expires" content="900">
<meta http-equiv="refresh" content="3600">

Volker Dirr

#5
your booking doesn't work automatically yet? sound like pretty much work then. maybe have a look at TiTiTo, since you administrater can book rooms much easier with it and the new timetable will be "generated" much faster. Changes are easier to see (for students and teachers!). It also refresh the html page more frequently. (but i much admit i done it with javascipt, since i also use javascript for scrolling, so you can see the changes of the current timetable on big screens in our school. But you can try your suggested code; it looks correct. So even if students are ill or late, teachers are ill or late, ... everybody can check very quick that the activity swapped the room. even if i reload regulary, the traffic is pretty low, since i didn't upload the whole timetable. Only the changes from default one.)

math_user

Thanks for your suggestion, Volker!
I have had a brief look at TiTiTo. Looks great! But have I understood correctly that it is mainly for changes during the semester? We have changes before the semester starts (e.g. bigger room because lots of students selected the subject). There should not be too many changes after the semester has started.
It would be nice to switch to TiTiTo (and the corresponding Outlook timetables). But our administration works with Evento for the student administration (export to Ilias, grades in Evento, and so on). So I am not sure if it is realistic to switch. But I will keep it in mind.

The test with expires and refresh seems to be successful. Could this be integrated into FET? Or only for custom versions?

Volker Dirr

TiTiTo is designed for DURING. not before. why do you need a booking system before? can't the teacher simply say the needed room at the beginning?

in my opinion it should be only custom version. but Liviu is the guy in charge.
if guys have old versions in their broswers they can also press "F5" or "update".
adding that is in my opinion not a good style, because of:
- disadvantage of high(er) sever and internet/LAN traffic
- you will have similar problems with other pages in the internet. i think you should tell them how to reload. (or disable the cache in the webbrowser?)

Liviu Lalescu

I think it is better as a custom version, as Volker says.

math_user

I have found quite a good solution:
Just add the following lines to the .htaccess-file:
ExpiresActive On
ExpiresDefault A3600

That means pages expire 3600 seconds after access.

Volker Dirr

ah. ok. that is a way how to increase internet traffic and server time.
if you think that is a fine solution, then you can do it of course.
Server time is mainly your problem.
Internet traffic might effect also other users (if you won't work in a LAN). So if you do that over Internet, than it is possible of course, but don't forget that you annoy other Internet users. If every guy past that lines on their homepages, than the internet will slow down very much.

math_user

I only use it for the timetables - not for all pages.
I do not think this generates much more traffic. Most users won't stay on the timetable page for more than one hour. When they access next time (a week later or so), then the page should reload as it might have changed in the meantime.
Perhaps one could increase the duration (1 day instead of 1 hour).