AzUrlShortener icon indicating copy to clipboard operation
AzUrlShortener copied to clipboard

[Improvement] SEO optimization and caching

Open jpawlowski opened this issue 4 years ago • 2 comments

Hey there!

A few comments what I discovered during my testing today:

  1. Using HTTP/1.1 301 Moved Permanently to redirect content instead of HTTP/1.1 302 Found would be a better choice. Search engines will honor 301 better than 302 (read here for example). This will make Google happier.

  2. Cache control could be improved to avoid reverse proxies will behave uncontrolled and absorb requests that won't end up in the statistics. This would indeed be a requirement to force browser to not cache 301 responses as they would usually do in comparison to 302.

To achieve this, these response headers can easily be added to the Azure Function like this:

image

I could provide a patch for these lines of code, if desired.

┆Issue is synchronized with this Trello card by Unito

jpawlowski avatar May 04 '21 23:05 jpawlowski

The Azure Function v4 don't have proxies anymore. The Doc of AzUrlShortener currently suggest using Cloudflare rules. However, we could update the doc for 302...

fboucher avatar Dec 12 '22 15:12 fboucher