473,785 Members | 2,423 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

request for a page using random id to get the fresh copy each time

dmjpro
2,476 Top Contributor
when a page is placed then it can be refresh using JS.

but if i request for a page using AJAX then how can i get the fresh copy every time.

i did that using caching management....
i mean .... adding caching related response headers.
without managing caching , getting a updated copy of a page every time using AJAX is not possible?

plz clear the funda.

regards.
Apr 30 '07 #1
4 1644
iam_clint
1,208 Recognized Expert Top Contributor
sure it is add a random query string to the link

www.blah.com/default.asp?rnd =129039823910

randomize that last number and it should give you a fresh copy everytime.
Apr 30 '07 #2
sumandey
1 New Member
ohhh .... what a fantastic idea.

thanx ...... lot of thanx.
May 1 '07 #3
dmjpro
2,476 Top Contributor
recently i asked a question ..... how can i get a fesh of requested page each time without using cache management?

then an expert answerd me that using radom id generator .....
http://my_page_name?ra ndom_id=a_rando m_number.

seeing this technique i was very impressed.

but today when i put it into the reality then a question comes to my mind that ....if i use this then my local machine stores each copy having an illusion that user may request for that page with same random number.

then unnecessarily same page will be stored again again .. then to fit the space the local machine may delete some important pages.

so is it a good programming practice ? i m confused.

plz help.
Regards.
May 6 '07 #4
pbmods
5,821 Recognized Expert Expert
recently i asked a question ..... how can i get a fesh of requested page each time without using cache management?

then an expert answerd me that using radom id generator .....
http://my_page_name?random_id=a_random_number.
Actually, we prefer to use new Date.getTime() instead. That way there's no chance of collision, and you can use it to find out your User's timezone for time-based output :)

so is it a good programming practice ? i m confused.
This is (IMnsHO) a hack. If you want to prevent the browser from caching your page, then set the appropriate headers (by default, PHP does this for you automatically).

Here's a really good tutorial on web caching that I found the other day:
http://www.web-caching.com/mnot_tutorial/
May 6 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
10651
by: turnit \(removethis\) | last post by:
I have a login form that uses the post method to carry the information to the next page. The form works just fine in ie6.0, but fails in mozilla and fails in ie5.2 on a mac. "HTTP/1.1 400 Bad Request" was the original error msg now that I reinstalled iislockdown and urscan I get "The parameter is incorrect." If I use the get method with this form it works just fine on everything. I can't say for certain but I think this problem started...
3
2273
by: Ron Lessnick | last post by:
I have to continuously download the same web page on our IIS server. It is important to always download a fresh page from the server including not only the .asp page itself but all the .gif and .jpg files associated with that page. We need to measure statistical info on how long it takes to download. If the page is stored in the client machines internet cache that would be a problem. Now I know how to add the following to the main .asp...
1
3313
by: andrewdreib | last post by:
I am still very new to ASP and am trying to create an ASP page that gets records from a database. Right not I can successfully get one field of information at a time and randomize it, but I need the whole string. I've been searching the internet trying to find an answer to this question and I found these two commands Request.querystring and Recordset.GetString, but I don't think I know how to use them properly. Here's the code I have...
10
6951
by: Bo Rasmussen | last post by:
Hi, I have a problem : I have a form with some buttons. When one of these buttons is pressed a new URL with some parameters to e.g. delete something from a database. The problem is that when the user presses refresh that same URL is fired with the parameters to delete again - this sometimes gives strange behaviour. Is there any way that I can stip of parameters when reloading a page such that only the webpage is deleted e.g. ...
11
1599
by: sudhaoncyberworld | last post by:
Hi all i am using asp.net v2.0 In one of my page i am calling another page using xml http , this is working fine but first time only , I am sending the request on click of button , when i click the button second time, it's returning the previous response and it's not even calling that page again, where could be the problem.
7
2129
by: Jean-David Beyer | last post by:
I have six hard drives (4 SCSI and 2 EIDE) on my main machine with parts of a database on each drive. The main index is on one SCSI drive all to itself. The main data are on the other three SCSI drives. Small relations are on one EIDE drive, and the logfiles are on the other EIDE drive. When running the task, below, the rest of the machine is not doing much. I do not remember where I saw it, but somewhere I got the idea that the number...
136
5543
by: Merrill & Michele | last post by:
A derangement is a mapping of a set onto itself leaving no element fixed. I realized that that was what I was programming when I was asked to randomly determine who buys presents for whom this year in my wife's family. Obviously, one does not buy for himself. The code is followed by some questions. #include <stdio.h> #include <stdlib.h> #include <time.h>
12
2153
by: Mark Rae | last post by:
Hi, See the previous thread Request.Form abuse in this newsgroup... I'm looking for a simple and efficient way to prevent people hijacking the <formtags on my websites and using them to send spam. I would imagine they're using the HttpWebRequest method for this. Essentially, it would require a property on a WebForm that indicates whether it is *only* for PostBack (true by default, but configurable), which would
1
4471
by: Joe | last post by:
In ASP.NET 1.1 I could detected expired form authentication tickets (which closely coincide with my expired session) by checking for the Authentication Cookie when the login screen loads. If the cookie exists, then decrypt the forms auth. ticket and check to see if it is expired. If so display a message to the user letting them know why they are back on the login screen. The code I used was something like this: Dim cookie as HttpCookie...
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9483
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10346
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.