Writing static HTML?

I have a forum but, unlike most forum, posts are deleted periodically.
I’d like the administrator to optionally choose whether or not he wants
deleted posts archived (removed from the database but stored on the
fileserver) so that he or she can do whatever with the posts.

When a post is deleted, I’d like it to be saved as static HTML and have
the appearance of however it would have been rendered at the given
moment of its deletion. But I have no clue how to do this without
hurting my fragile brain. Any ideas?

Guest wrote:

Eleo wrote:

I have a forum but, unlike most forum, posts are deleted periodically.
I’d like the administrator to optionally choose whether or not he wants
deleted posts archived (removed from the database but stored on the
fileserver) so that he or she can do whatever with the posts.

When a post is deleted, I’d like it to be saved as static HTML and have
the appearance of however it would have been rendered at the given
moment of its deletion. But I have no clue how to do this without
hurting my fragile brain. Any ideas?

Why delete them from the database if the pages constructed from the
database will still be present?

Although I don’t see the benfit in this approach, you can probably do it
with page caching. Just don’t clear the page cache for that page when
the post gets deleted.

I guess for efficiency. There’s no reason for them to be there if users
aren’t supposed to ever see them. Won’t more rows just slow down
database queries?

Eleo wrote:

I have a forum but, unlike most forum, posts are deleted periodically.
I’d like the administrator to optionally choose whether or not he wants
deleted posts archived (removed from the database but stored on the
fileserver) so that he or she can do whatever with the posts.

When a post is deleted, I’d like it to be saved as static HTML and have
the appearance of however it would have been rendered at the given
moment of its deletion. But I have no clue how to do this without
hurting my fragile brain. Any ideas?

Why delete them from the database if the pages constructed from the
database will still be present?

Although I don’t see the benfit in this approach, you can probably do it
with page caching. Just don’t clear the page cache for that page when
the post gets deleted.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs