Skip to main content
Participant
June 21, 2006
Question

CFLOCATION

  • June 21, 2006
  • 3 replies
  • 467 views
Hi,

I am using cflocation to redirect to a page after doing process on server side like database updates, some time the page is redirecting properly and the content of the new page also displaying, and some times it is redirecting to a new page but the content is not displaying..if i refresh the browser then content is display.

Wondering if any one come across this type of situation.

Looking for your suggestions in fixing this issue.

Thanks in advance

-Raaga
    This topic has been closed for replies.

    3 replies

    Inspiring
    June 22, 2006
    Not sure if this is your problem, but CFLOCATION has a history. For example, CFLOCATION used after a CFCOOKIE call used to forward without executing the CFCOOKIE. I haven't used CFLOCATION since then. Instead I use JavaScript to forward since that will not run until CF is finished executing.

    <CF CODE>

    <script>
    location.href='updated_page.cfm';
    </script>
    Participating Frequently
    June 22, 2006
    From your description you do not need CFLOCATION at all. Use CFINCLUDE or something similar. CFLOCATION makes an extra trip to the server and, therefore, affects the overall performance. If you really need this, add something unique to URL, for example "?#GetTickCount()#', to avoid potential caching.
    Participant
    June 22, 2006
    Thank you very much for the info.

    -Raaga
    Participating Frequently
    June 21, 2006
    Sounds like Browser caching to me. Add the following to any database pages to ensure the last Browser page is always thrown away. Actually put it in application.cfm or a _Header.cfm include and you'll never have to worry about it again.
    Somewhere in between the <head></head> tag's add in a:

    <META HTTP-EQUIV="Expires" CONTENT="01 Jan 2000">