/    Sign up×
Community /Pin to ProfileBookmark

Cache-based redirect

Hello all,

I am new to the forum here and I am looking for some help. There is a page that I am developing that is supposed to work in the following way:

a. User signs up for the product
b. User visits the page
c. Once the user visits the page and the page is cached, a timer starts on the cache
d. Once the timer is reached, if they visit the page again, they are automatically redirected to another page

The part I need help with is how to get the page to begin a timer for the cache, and redirect after that timer reaches “x” (i.e. redirect page automatically after 7 days from the user’s first visit). Hopefully my description is not to vague; please let me know if I need to expound on anything.

Thanks in advance for your help! ?

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@TheAliveWinnerFeb 29.2012 — [B]I don't know whether this would be helpful to you or not because I have not used it yet!



[I]Check this:[/I] [/B]
[URL]http://www.w3schools.com/html5/html5_webworkers.asp[/URL]
Copy linkTweet thisAlerts:
@shoresideauthorFeb 29.2012 — [B]I don't know whether this would be helpful to you or not because I have not used it yet!



[I]Check this:[/I] [/B]
[URL]http://www.w3schools.com/html5/html5_webworkers.asp[/URL][/QUOTE]


Thanks for the heads up, but the only problem is that I need this redirect code to start a new timer for every user from the time they open it. If the js var holds a count, and reaches the end of that count, it will re-direct everyone automatically instead of using a unique count for each user...

Thoughts?
Copy linkTweet thisAlerts:
@shoresideauthorFeb 29.2012 — Thanks for the heads up, but the only problem is that I need this redirect code to start a new timer for every user from the time they open it. If the js var holds a count, and reaches the end of that count, it will re-direct everyone automatically instead of using a unique count for each user...

Thoughts?[/QUOTE]


I thought I should clarify a bit...what the code is supposed to do is have a unique count for each user, not a single count for all users.

Does that make sense?
Copy linkTweet thisAlerts:
@WyCnetFeb 29.2012 — Let me find a language to describe your situation: Client_X, Product_Page_Y, Client_X_Browser, Product_Page_JService. You have control at the Product_Page_JService, concerning

how to distribute Product_Page_Y. Suppose Client_X has the Client_X_Browser active for a week then you can calculate the time interval and act on it, otherwise cookies are neededl at the Client_X_Browser.

Timers are not needed, only an initial time and the current time.
Copy linkTweet thisAlerts:
@shoresideauthorFeb 29.2012 — Let me find a language to describe your situation: Client_X, Product_Page_Y, Client_X_Browser, Product_Page_JService. You have control at the Product_Page_JService, concerning

how to distribute Product_Page_Y. Suppose Client_X has the Client_X_Browser active for a week then you can calculate the time interval and act on it, otherwise cookies are neededl at the Client_X_Browser.

Timers are not needed, only an initial time and the current time.[/QUOTE]


I know that I need this to be cache based, but wouldn't I need to begin the timer in js and once the timer reached X point, activate the code which references the cache to determine if a redirect was necessary?
Copy linkTweet thisAlerts:
@shoresideauthorMar 01.2012 — I was thinking about, and I believe that I've got the idea down...I just don't know exactly how to implement it.

a. Log the MAC address for the user (if possible)

b. Get the current month, day, and year

c. Set the timer to "X" days from the current date

d. Send the MAC address, current month, day, and year to a database

e. Each time the user visits the page, the js references the database to determine if the current date is "X" days past the date input in the database

f. If the current date is past "X" days since the initial view, activate the re-direct portion of the js script

The things I'm not sure on is if you can obtain the MAC address (I think this is possible), how to account for month to month rollover with the timer, how to send the information from js to the database, and how the use js to reference the database and return values upon each visit.

Thoughts? Thanks in advance for your help!
Copy linkTweet thisAlerts:
@shoresideauthorMar 01.2012 — Thoughts???
Copy linkTweet thisAlerts:
@shoresideauthorMar 02.2012 — I'm still hoping for a bit of help on this...does anyone have any ideas? Thanks! ?
×

Success!

Help @shoreside spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...