Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 716955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:21:28+00:00 2026-05-14T05:21:28+00:00

Hi there i’ve built a new script (from scratch not a CMS) and i’ve

  • 0

Hi there i’ve built a new script (from scratch not a CMS) and i’ve done alot of work on reducing memory usage and the time it takes for the page to be displayed (caching HTML etc)

There’s one thing that i’m not sure about though. Take a simple example of an article with a comments section.

If the comment form posts to another page that then redirects back to the article page I won’t have the problem of people clicking refresh and resending the information.

However if I do it that way, I have to load up my script twice use twice as much memory and it takes twice as long whilst i’m still only displaying the page once.

Here’s an example from my load log. The first load of the article is from the cache, the second rebuilds the page after the comment is posted.


Example 1

0 queries using 650856 bytes of memory in 0.018667 – domain.com/article/1/my_article.html

9 queries using 1325723 bytes of memory in 0.075825 – domain.com/article/1/my_article/newcomment.html

0 queries using 650856 bytes of memory in 0.029449 – domain.com/article/1/my_article.html

Example 2

0 queries using 650856 bytes of memory in 0.023526 – domain.com/article/1/my_article.html

9 queries using 1659096 bytes of memory in 0.060032 – domain.com/article/1/my_article.html


Obviously the time fluctuates so you can’t really compare that. But as you can see with the first method I use more memory and it takes longer to load.

BUT the first method avoides the refresh problem.

Does anyone have any suggestions for the best approach or for alternative ways to avoid the extra load (admittadely minimal but i’d still like to avoid it) whilst also avoiding the refresh problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:21:28+00:00Added an answer on May 14, 2026 at 5:21 am

    Optimization efforts are always commendable, but in this specific case I see zero benefit in saving a few queries, and some RAM, for a few seconds. Definitely go with example 1 (or whatever is best from a programming, maintenance and user experience perspective).

    I don’t know about your server setup and all that so judging run times and memory consumption are always subjective, but you seem to be doing pretty well. Look at WordPress where the average script instance (at least in the backend, haven’t measured the frontend) weighs between 6 and 12 MB. Don’t worry too much about optimization.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 382k
  • Answers 382k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You need to use multi threading to perform this task… May 14, 2026 at 10:25 pm
  • Editorial Team
    Editorial Team added an answer If you want the shell to do the I/O redirection,… May 14, 2026 at 10:25 pm
  • Editorial Team
    Editorial Team added an answer Go to Tools->Extension manager, and search the online gallery for… May 14, 2026 at 10:25 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.