0

I have a rails (4.1.5) app deployed on Heroku and monitored with NewRelic. In the last 24 hours the site has gone from having < 3% errors on NewRelic to having ~30% errors and all the errors are to do with requests for expired javascript and css assets. I have not deployed to the site in over a month so the assets shouldn't have changed.

My question is two-fold;
First, why would I suddenly be getting a load of requests for an expired asset?
Second, is their a rails way to handle a request for an expired asset and redirect it to the current asset?

Sujimichi
  • 466
  • 7
  • 16
  • How many visits is your site getting? Can it be that a small proportion of users or even a single user generates 30% of requests? Have you checked the erroneous requests source ips to see a pattern? – Nic Nilov Jun 28 '16 at 11:31
  • @NicNilov site gets about 1300 unique users (and ~8000 page views) per day. The error spikes in NewRelic started gradually, a few spikes per hour but are now showing as an almost constant >30% error. I'm not sure how to get the request IPs out of newRelic. – Sujimichi Jun 28 '16 at 15:58
  • You could parse the logs to extract the IPs. Anyway, my line of thought was it could be generated by something having stale links to your assets. One such source could be earlier sent emails referencing images or stylesheets. This hardly explains javascript assets being requested though. – Nic Nilov Jun 28 '16 at 16:02
  • @NicNilov I deployed some changes today, so current js and css assets were expired and the new ones compiled. The requests for expired assets have almost completely gone, (just a couple, which could be a single user). Still mystified as to why I was getting so many requests for old assets, but at least it's not happening now. – Sujimichi Jun 29 '16 at 18:15

0 Answers0