1

:trailing_slash - If true, adds a trailing slash, as in “/archive/2005/”. Note that this is currently not recommended since it breaks caching.

https://apidock.com/rails/v4.1.8/ActionView/RoutingUrlFor/url_for

Maciej Nędza
  • 372
  • 2
  • 11

1 Answers1

1

Resources with / and no-/ are both seen as different resources but serve the same content. It's therefore seen as duplicate content. The browser sees them as different resources and caches both of them separately.

Google tells you more about this topic.

Tobias
  • 4,523
  • 2
  • 20
  • 40
  • Im sorry. What I really wanted to do is this question. But the question was edited while I was spacing out. The previous question: Why does not rails recommended using a trailing slash?(the mean includes "why does rails so worry about breaks caching".) – shota_matsukawa Mar 14 '18 at 05:31
  • @shota_matsukawa the framework wants you to guide to the best practices of the web. Therefore they tell you whats good and whats bad. And in the conventions of the framework they prefer best practices. – Tobias Mar 14 '18 at 08:50