Varnish caching for artist data and lastfm suggest
This commit is contained in:
parent
98f4311527
commit
78484b8fd3
|
@ -64,4 +64,4 @@ $('#search-form').live 'submit', ->
|
|||
false
|
||||
$('.data.artist').live 'click', ->
|
||||
_search.loadArtistData $(this).html()
|
||||
false
|
||||
false
|
||||
|
|
|
@ -32,6 +32,7 @@ class ArtistController < ApplicationController
|
|||
return render json: { status: 'fail', html: render_compact_partial(:fail) }
|
||||
end
|
||||
|
||||
response.headers['Cache-Control'] = 'public, max-age='+1.week.seconds.to_s
|
||||
render json: {
|
||||
status: @artist.status_str,
|
||||
artist: @artist,
|
||||
|
|
|
@ -86,6 +86,8 @@ class LastFmController < ApplicationController
|
|||
autocomplete["response"]["docs"].each do |doc|
|
||||
suggestions << doc["artist"] unless suggestions.include?(doc["artist"]) or doc["artist"].nil? or doc['restype'] != 6
|
||||
end
|
||||
|
||||
response.headers['Cache-Control'] = 'public, max-age='+1.week.seconds.to_s
|
||||
render :json => {
|
||||
:query => params[:query],
|
||||
:suggestions => suggestions.take(5)
|
||||
|
|
Loading…
Reference in New Issue