I cant think of a reason why an insert query should be cached, so any
caching would probably be uneccessary.
A solution to your problem would be to check for the existense of a record
before inserting or, if there is no reason why the user would validly need
to go back, make the page content expire and if they hit back, they will
need to refresh. Which will cause any form fields to clear and there would
be nothing to insert then...
This snippet does the trick for me.

  <CFHEADER NAME="Expires" VALUE="Mon, 06 Jan 1990 00:00:01 GMT">
  <CFHEADER NAME="Pragma" VALUE="no-cache">
  <CFHEADER NAME="cache-control" VALUE="no-cache">

jon
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, January 17, 2001 10:25 AM
Subject: duplicating inserts


> Anyone know of a way to stop records from being reinserted into a
> database when a user hits the back button?  I have a page that checks
> for duplications in a database, and if it finds no duplicate, then it
> will insert it into the database.  Problem is, when a user hits the back
> button, it inserts the record again.  Its not finding duplicates more
> than likey because the query is being cached so it doesnt know to look
> again.  But how can I get it to either do nothing including not
> inserting the record a second time or atleast recheck again to see if
> its a duplicate record?  I can't take caching off this machine as these
> are some monster queries and performance is greatly improved by caching
> queries.
>
> Thanks
>
>    ***********************************
>    Misty Woodward
>    ODS Decision Support
>    tel: 913.315.6583
>       email: [EMAIL PROTECTED]
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to