20 lines
419 B
Ruby
20 lines
419 B
Ruby
module EdgeCache
|
|
class BustUser
|
|
def self.call(user)
|
|
return unless user
|
|
|
|
username = user.username
|
|
user_id = user.id
|
|
paths = [
|
|
"/#{username}",
|
|
"/#{username}/comments",
|
|
"/live/#{username}",
|
|
"/feed/#{username}",
|
|
"/api/users/#{user_id}",
|
|
]
|
|
|
|
cache_bust = EdgeCache::Bust.new
|
|
paths.each { |path| cache_bust.call(path) }
|
|
end
|
|
end
|
|
end
|