Opened 2 years ago

Closed 20 months ago

#1487797 closed Bugs (fixed)

Proxy middleware caching support

Reported by: amosjeffries Owned by:
Priority: 3 Milestone: 0.7-beta
Component: Core functionality Version: 0.5.1
Severity: normal Keywords:
Cc:

Description

I'm working in an environment involving reverse-proxy CDN and a web server where the PHP cache-busting Cache-Control: headers have been disabled.

Unfortunately roundcube 0.5.1 is completely unusable in its current form.

  • During install and setup the administrator is faced with 4xx.

This appears to be due to roundcube leaking the non-standard 60x status codes which are also used internally by the middleware and mapped to a different irrelevant error page for final presentation. The web standards define 500 status as the correct one to output for generic server-end problems.
The attached patch http-6xx-status maps these internal status codes to 500 for final display to the client.

  • Login fails to work most of the time. When it does get to the mail area the user finds themselves logged into another users account.

This is caused by reliance on the PHP defaults. Which are configurable in PHP and thus not reliable. The attached patch proxy-support adds heavy-handed no-store and private flags to the Cache-Control for all roundcube PHP outputs. This works but if someone with more knowledge is able to fine-tune it to only be sent when there really is private not-to-be-stored objects that would allow better performance.

There is one other unresolved error still occurring despite these patches.

On first page view after a new browser has been opened and logged in the mail text area displays empty and "Server Error! (error)" is displayed to the user. This will also occur apparently randomly during mail browsing.

I have tracked it down to the X-Roundcube-Request token on /?_task=mail&_remote=1&_action=list&_mbox=INBOX&_refresh=1... XMLHttpRequest requests. The browser appears to retain old values until a logout is manually performed within the current session. After which a second login uses some value roundcube will accept.

Change History (8)

comment:1 Changed 2 years ago by amosjeffries

grr, Trac is refusing to accept attachments:

Submission rejected as potential spam (Content contained these blacklisted patterns:

comment:2 Changed 2 years ago by till

Can you use friendpaste.com or pastie.com and share the URL?

comment:3 Changed 2 years ago by amosjeffries

grr, URLs show up as "Akismet says content is spam", posting the patch as attachment or inline Trac says blacklisted keywords, referencing some of the code syntax.

Lets try this: treenet dot co dot nz slash http-6xx-status dot patch
and same for the other patch name.

comment:4 Changed 2 years ago by till

--- /usr/share/roundcube/program/steps/utils/error.inc.orig	2011-02-15 12:07:45.000000000 +1300
+++ /usr/share/roundcube/program/steps/utils/error.inc	2011-02-15 12:08:10.000000000 +1300
@@ -72,12 +72,14 @@
 {
   $__error_title = "CONFIGURATION ERROR";
   $__error_text  =  nl2br($ERROR_MESSAGE) . "<br />Please read the INSTALL instructions!";
+  $ERROR_CODE = 500;
 }
 
 // database connection error
 else if ($ERROR_CODE==603) {
   $__error_title = "DATABASE ERROR: CONNECTION FAILED!";
   $__error_text  =  "Unable to connect to the database!<br />Please contact your server-administrator.";
+  $ERROR_CODE = 500;
 }
 
 // system error

comment:5 Changed 2 years ago by till

--- index.php.2011-02-03.backup	2011-02-03 12:10:08.000000000 +1300
+++ index.php	2011-02-03 12:31:46.000000000 +1300
@@ -1,4 +1,6 @@
 <?php
+header("Cache-Control: no-store, private");
+
 /*
  +-------------------------------------------------------------------------+
  | RoundCube Webmail IMAP Client                                           |

comment:6 Changed 2 years ago by alec

  • Component changed from Addressbook to Core functionality
  • Milestone changed from later to 0.6-beta

comment:7 Changed 2 years ago by alec

First part fixed in [d7b35c22].

comment:8 Changed 20 months ago by alec

  • Resolution set to fixed
  • Status changed from new to closed

Caching issue fixed in [9e54e6fd].

Note: See TracTickets for help on using tickets.