Thursday, 15 April 2010

internet explorer - IE9 not clearing cache in between posts -



internet explorer - IE9 not clearing cache in between posts -

i have page following:

click button submit form page posts itself, , sql query executed update field in db. the code checks if there affected rows query execution , echoed. expect echo affected rows "1"

in firefox, safari, , chrome, operation works every time without fail. in ie9 though, works first time, maybe 2 times or 3, , weird - it echoes affected rows "0" - even though query executed fine (the db updated).

i believe cache problem of sort, because when clear browser cache in ie before step 1 (submitting form) works every time desired.

ive tried using code:

header('cache-control: no-cache, no-store, must-revalidate'); // http 1.1. header('pragma: no-cache'); // http 1.0. header("expires: sat, 26 jul 1997 05:00:00 gmt"); // date in past

and in <head> tag:

<meta http-equiv="cache-control" content="no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="mon, 26 jul 1997 05:00:00 gmt" />

what going on? how can stop ie playing this?

update:

there seems sort of inconsistency php pdo's rowcount() (used affected rows)... in case, can't imagine how, inconsistency linked browser cache. instead of using rowcount() after executing query, perform select determine whether field updated new val. seems working consistently.

rather using pdo's rowcount() after executing query, perform select query determine whether field updated new val.

pseudo code/sql:

update table set field = 'new value' field = 'old value' select row table field = 'new value' if row returned field updated

internet-explorer session post http-headers browser-cache

No comments:

Post a Comment