2

I would like to delay code execution for a single request (based in IP address) efficiently without affecting the overall server performance (so Thread.Sleep is not an option?).

How can this be done?

(this is to annoy specific people for a certain amount of time, while still providing correct functionality when the time is over..)

1

2 Answers 2

1

In my opinion, I wouldn't do such thing in your application layer, this is a Web server task rather than your own logic.

Instead of that, what about this IIS module?

Sign up to request clarification or add additional context in comments.

Comments

0

you can do it serving content using pageMethods and delay the ajax call with javascript:

window.setTimeout(function () { PageMethods.RenderContent(); }, 100000);

2 Comments

I agree, but the original question was saying: "this is to annoy specific people for a certain amount of time". Which means in my opinion that they do not require a bullet proof solution!
Anwyay, double-check your approach... serving content using PageMethods...?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.