Solved

CFHTTP and web caching...  will this work?

Posted on 2003-11-05
5
327 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

831 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