Index: src/orca/orca.py
===================================================================
--- src/orca/orca.py	(revision 3245)
+++ src/orca/orca.py	(working copy)
@@ -168,6 +168,10 @@
         # Either it's None or it's an invalid remote object.
         oldLocusOfFocus = None
 
+    orca_state.focusHistory = \
+        orca_state.locusOfFocusHistory[:settings.focusHistoryLength - 1]
+    orca_state.focusHistory.insert(0, oldLocusOfFocus)
+
     orca_state.locusOfFocus = obj
     try:
         app = orca_state.locusOfFocus.getApplication()
Index: src/orca/orca_state.py
===================================================================
--- src/orca/orca_state.py	(revision 3245)
+++ src/orca/orca_state.py	(working copy)
@@ -30,6 +30,10 @@
 # easily cause circular imports.
 #
 
+# History of focused accessibles, helps caching.
+#
+focusHistory = []
+
 # The Accessible that has visual focus.
 #
 locusOfFocus = None
Index: src/orca/settings.py
===================================================================
--- src/orca/settings.py	(revision 3245)
+++ src/orca/settings.py	(working copy)
@@ -754,4 +754,10 @@
 
 # Show deprecated messeges in debug output.
 # Set this to True to help find potential pyatspi porting problems
+#
 deprecatedMessages = False
+
+# Focus history length. We keep a reference to past focused accessibles to 
+# maximize on caching.
+#
+focusHistoryLength = 5
