# Rebake All Posts Optimization

**URL:** <https://meta.discourse.org/t/rebake-all-posts-optimization/228327>\
**Category:** Support\
**Created:** [May 28, 2022, 5:25pm UTC](https://meta.discourse.org/t/rebake-all-posts-optimization/228327 "2022-05-28T17:25:19Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [May 30, 2022, 3:33pm UTC](https://meta.discourse.org/t/rebake-all-posts-optimization/228327/3 "2022-05-30T15:33:17Z")

</div>

> [@Ghan](#):
>
> The field is an integer but is it necessary to reset it for all posts before we do any rebake operation? As I said, this single call takes hours to run because of the size of our post table. I have slightly modified the rebake code to instead make this call for each post right before the rebake is called. Is there a better way?

You can just issue a `post.rebake!` for every post that needs a rebake.  
No need to mess with `baked_version`.

---

_[View the full topic](https://meta.discourse.org/t/rebake-all-posts-optimization/228327)._
