Commit graph

4 commits

Author SHA1 Message Date
Alex
7ee8523ba3
Refactor EdgeCache (#11684)
* Refactor EdgeCache

* Update specs

* Add bust comment spec

* Fix more specs

* Use const_get

* Make methods private

* Add .discussion? decorator to Article

* Change variable name to article for clarity
2020-12-02 14:20:22 -05:00
Molly Struve
bac4a3ca4b
Force Unique Jobs for User Initiated Jobs and Cache Jobs (#7688) 2020-05-06 08:27:17 -05:00
rhymes
1bc0469b2d Add article's record key to Fastly Surrogate-Key to separate caches (#5543)
* Add article's record key to Fastly Surrogate-Key to separate caches

After #4744 we successfully setup an auto purging system based on Fastly's surrogate key based cache and purging API.
Unfortunately this worked only in the `:show` action as comments are their own tree-based resource.
The `:index` though, is related to a single article, so without the article's record key in the `Surrogate-Key` header the first time we hit the API the result would become the value stored in Fastly's API, for all articles.

* Fix commentable mock for job spec

* Add comment.commentable.purge to the worker as well

* Add more thorough tests for commentable
2020-01-17 08:45:47 -05:00
Asha Balasubramaniam
81ead4935a Migrate Comments::BustCacheJob to Comments::BustCacheWorker and move to Sidekiq (#5502) 2020-01-16 10:20:13 -05:00