Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strange underscore param in remote links

I use Rails3, JQuery and will_paginate gem to make remote pagination links. Known solution for this is:

$('.pagination a').live('click',function (){
  $.getScript(this.href);
  return false;
});

With this code I get links like: http://localhost:3000/products?_=1300468875819&page=1 or http://localhost:3000/products?_=1300468887024&page=2. So the little question is: what is this strange param _=1300468887024 (looks like Unix-time). What is its purpose? As I know this can cause some problems with search crawlers.

UPD: The solution is described here.

like image 310
sunki Avatar asked Mar 18 '11 17:03

sunki


2 Answers

it's a cache buster. It's also used in development mode, so to avoid getting an old request from the browser cache.

(unfortunately, all the explanations I found are realated to advertisement :S)

like image 65
Augusto Avatar answered Sep 30 '22 10:09

Augusto


This is a simple solution if you don't mind removing it for all requests:

jQuery.ajaxSetup({ cache: true });
like image 42
DanS Avatar answered Sep 30 '22 09:09

DanS