Project

General

Profile

Design Notes » History » Version 1

Luke Murphey, 11/21/2015 07:57 AM

1 1 Luke Murphey
h1. Design Notes
2 1 Luke Murphey
3 1 Luke Murphey
h2. AJAX content loading caching system
4 1 Luke Murphey
5 1 Luke Murphey
The content for the reading pages is cached in order to reduce the loading time of the chapters. This is necessary because rendering is expensive. This works by:
6 1 Luke Murphey
7 1 Luke Murphey
# Caching the current page on the server
8 1 Luke Murphey
# Pre-loading the next page so that it is pre-cached
9 1 Luke Murphey
10 1 Luke Murphey
The way that this works is that the template for the page will only return the non-content part of the page if the request is not an AJAX request. This will not be cached.
11 1 Luke Murphey
12 1 Luke Murphey
On the other hand. if the request is for an AJAX request, then only the content part of the page will be returned. This will be cached.
13 1 Luke Murphey
14 1 Luke Murphey
h2. ajaxify: what does it do?
15 1 Luke Murphey
16 1 Luke Murphey
The ajaxify decorator changes the page that will be returned such that it is a shell that will request the actual page. This is useful in order to show content to a user quickly with a progress-bar instead of showing a white screen while the content is prepared.