Hi,
I had a number of users report that differing user names were appearing on various peoples screens. It seemed obvious to me that, since they were behind a proxy, that the pages were being cached. But I didn't expect this to be happening as, as I understood it, auth users weren't cached. Also, some threads a year or so ago put in the http headers to ensure external proxies didn't cache pages.
However, with a bit of wget work, I soon realised that if, in admin >> settings >> cache settings, of the page caching is disabled then the vital headers that stop external proxy caching do not get sent.
My quick fix to ensure that auth users always have the "no cache" headers sent out are in my patch. However, I doubt I have implemented in the correct way but it got me "out of a hole" quickly.
So my issue is "not send external no cache headers if page caching is switched off" Is this normal?
best regards,
--AjK
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | bootstrap.inc_r1.96.2.2_patch01 | 4.55 KB | AjK |
| #7 | bootstrap.inc_1.100_patch04 | 4.64 KB | AjK |
| #5 | bootstrap.inc_1.100_patch03 | 4.64 KB | AjK |
| #1 | bootstrap.inc_1.100_patch02 | 1.4 KB | AjK |
| bootstrap.inc_1.100_patch01 | 1004 bytes | AjK |
Comments
Comment #1
AjK commentedOK, I believe this patch is the correct approach (ie having spent time looking at the problem as opposed to the knee jerk reaction patch above).
best regards,
--AjK
Comment #2
killes@www.drop.org commentedI think the two if clauses could be merged into one.
Comment #3
dries commentedWith the proposed change, we'll issue an extra (redundant) database query. page_get_cache() goes to the database ...
Comment #4
killes@www.drop.org commentedDries: Nope, it doesn't if the user is logged in. Thought the same initially.
Comment #5
AjK commentedKilles,
Patch but merging the two if()s
regards
--AjK
Comment #6
drummI do think it might add another query in some cases. If we flip around the conditions on the if statement, the variable_get() may evaluate to FALSE and short circuit to skip the page_get_cache() call. I think this would be better since variable_get() is relatively lightweight.
Comment #7
AjK commentedpage_get_cache() does in fact check $user->uid first in it's own test so I assumed that it being first would cause the additional possibility of a query.
However, since it does no harm to swap the two conditions and you guys know better, here's a patch with the two swapped as suggested.
best regards
--AjK
Comment #8
AjK commentedComment #9
drummCommitted to HEAD.
Comment #10
killes@www.drop.org commentedDoes this need to be fixed in 4.7 as well? If yes, I need a patch, cvs cvs one wouldn't apply.
Comment #11
AjK commentedAs requested, patch for the DRUPAL-4-7 branch.
best regards,
--AjK
Comment #12
drummLooks like the same code to me.
Comment #13
killes@www.drop.org commentedapplied
Comment #14
(not verified) commented