# Denying requests for Amazon Product Previews?

**URL:** <https://www.ruby-forum.com/t/denying-requests-for-amazon-product-previews/82463>\
**Category:** Rails\
**Created:** [January 19, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/denying-requests-for-amazon-product-previews/82463 "2007-01-19T16:30:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Straub](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecc23a/32.png) [@Ben\_Straub](https://www.ruby-forum.com/u/Ben_Straub)\
**Post date:** [January 19, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/denying-requests-for-amazon-product-previews/82463/1 "2007-01-19T16:30:37Z")

</div>

Hello,

I’m writing a toy wishlist application served by mongrel. It recognizes  
URL’s for Amazon items and inserts an affiliate ID, and I’ve enabled  
the Product Previews feature (check the demo here:  
[http://www.tictap.com/tca](http://www.tictap.com/tca) ) by including the following in my layout:

* * *
 ![](http://www.assoc-amazon.com/s/noscript?tag=mytag-20)---------------------------------------------

This works beautifully, and the previews pop up after all the JS is  
loaded (~5 sec), but my log is then filled to overflowing with things  
like this:

* * *

Processing PeopleController#function (property) { var results = [];  
this.each(function (value, index) {results.push(value[property]);});  
return results;} (for 127.0.0.1 at 2007-01-12 08:54:36) [GET]  
Session ID: 460f7da5266f6c1e87653c2ddf903023  
Parameters: {“action”=\>“function (property) { var results = [];  
this.each(function (value, index) {results.push(value[property]);});  
return results;}”, “controller”=\>“people”}

## ActionController::UnknownAction (No action responded to function (property) { var results = []; this.each(function (value, index) {results.push(value[property]);}); return results;}): …

That script include is sending LOTS of requests. At first I tried  
denying these with a before\_filter in my ApplicationController which  
returned false if it recognized the javascript in the request, but the  
browser is still making all the requests to the server on every page  
load, so the browser can’t do the hover-popup coolness until ~5 seconds  
after the page is visibly done rendering. I thought of using routing,  
but answers do not quickly reveal themselves on the intargoogle.

Any ideas? Ideally, I’d like the browser to stop sending requests for  
the javascript - it doesn’t happen with static pages served by apache.

– Ben
