mmmWiki cache

Caches etc

Caching of the actual page content

1 Cache on server

Parsed pages are cache on the database. If it is "fresh", then no parsing is needed and the cached page is returned.

2 Use of Web cache:

For public pages
Original request: cacheable (contains the content of the page).
Ajax request (secondary request): non-cacheble (contains info such as whether you are logged in as administrator or not).
For private pages
Original request: non-cacheable (contains info such as whether you are logged in as administrator or not).
Potential ajax request (secondary request): private-cacheable (only stored in your computer/browser) (contains the content of the page).

All cached requests of pages are validated (The request looks like normal, only containing the header-field if-modified-since and the server may answer with a short 304 (Not Modified))

3 Returning to a page during a session

If you return to a page during a session (regardless of what web app or web page you're surfing on), the web browser will not make a request (not even a validation request) of the page. This might cause a problem if you edit a page, goes forward, then hit back button, then you would get a stale page.

However with javascript you can change this behavior, and this is what's done if you have made any changes to the page.

This way hitting the backbutton will give very rapid (cached) response on pages that you have not changed, but still get up to date (but a bit slower) responses to pages that you have changed.

This behavior will however give you a stale page if other people have changed the page.

Caching of static files (js, css, image-files for the interface etc.)

Static files have their sha1-hash calculated and added to their url in the index-file which means that no request needs to be done unless they have changed.

Also ETag-header fields and 304 (Not Modified) are used.