Solved

CFHTTP and web caching...  will this work?

Posted on 2003-11-05
5
318 Views
Last Modified: 2013-12-24
Instead using an FTP transfer to get an XML file off a remote web server I thought about using CFHTTP to get it.  I was then told, it may not be good because the my internet connection is running through caching servers.

Then I started to think, what if I added a random number in a URL parameter in my CFHTTP :

<cfhttp url="http://www.website.com/file.xml?noCache=#RandRange(1,999)##RandRange(1,999)##RandRange(1,999)#" method="get"...>

Will this defeat any caching issues?
0
Comment
Question by:orangachang
5 Comments
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 9689296
I don't want to say I am 100% sure that would work but it should. Its the same idea as we do to get around caching servers;  we append a page request id to all the URL's. From what I can tell it has worked.
0
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 9689329
additionally unless you are doing it more often than 1 second why not just use now() instead of random numbers.

<cfhttp url="http://www.website.com/file.xml?noCache=#urlencodedformat(now())#" method="get"...>
0
 
LVL 4

Accepted Solution

by:
procept earned 100 total points
ID: 9693124
P_CF_DEV is right, but, instead of using now() or a random number, I would suggest using getTickCount()... it's unique for every millisecond...

<cfhttp url="http://www.website.com/file.xml?noCache=#getTickCount()#" method="get"...>

HTH,

Chris


0
 
LVL 2

Expert Comment

by:jonnygo55
ID: 9695522
all these will probably work for you or:
...noCache=#CreateUUID()#...
0
 
LVL 10

Expert Comment

by:substand
ID: 9699376
should work
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
This video discusses moving either the default database or any database to a new volume.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now