Solved

CFHTTP and web caching...  will this work?

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

Suggested Solutions

Title # Comments Views Activity
retrieving files from old server once DNS has changed 10 72
Configure a Local PHP Interpreter for Phpstorm 2 436
DNS, website, godaddy 6 95
Public IP Address Amazon Servers 2 62
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

726 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