Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Captain Bigzy on February 01, 2019, 08:38:59 PM

Title: Topic Posting Issue
Post by: Captain Bigzy on February 01, 2019, 08:38:59 PM
Hello all, I am having an issue with my forum where by when posting a new topic it shows right away as being a new post but takes a minute or 2 to actually display the topic, anyone got ideas on what could cause this?

edit: Sorry wrong support section!  please move to support 2.0.x please
Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 01, 2019, 09:48:32 PM
Just tried uninstalling Anti-spam by CleanTalk and it fixed the issue.  Wil mark as solved but would be nice to know why this mod is causing the topics to take so long to display
Title: Re: Topic Posting Issue
Post by: Aleksi "Lex" Kilpinen on February 02, 2019, 01:43:07 AM
That is probably because of how CleanTalk works. I'm not familiar with the mod, but this description is from CleanTalk:
- A visitor writes a comment or registers.
- CleanTalk plugin sends action parameters into the CleanTalk cloud.
- Service analyzes the parameters.
- If this is a visitor, the comment will be published. If it's a spam bot, then CleanTalk blocks this comment or registering.
- Parameters are written to the log which can be viewed in the Control Panel service.
Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 02, 2019, 10:35:18 AM
That is probably because of how CleanTalk works. I'm not familiar with the mod, but this description is from CleanTalk:
- A visitor writes a comment or registers.
- CleanTalk plugin sends action parameters into the CleanTalk cloud.
- Service analyzes the parameters.
- If this is a visitor, the comment will be published. If it's a spam bot, then CleanTalk blocks this comment or registering.
- Parameters are written to the log which can be viewed in the Control Panel service.

I thought so but I have removed the CleanTalk and I am still having this issue, ugh...
Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 02, 2019, 10:40:10 AM
For me if i post a new topic on my mobile it works fine, instantly shows, my friend tried and its not instant for him, i am so confused?
Title: Re: Topic Posting Issue
Post by: Aleksi "Lex" Kilpinen on February 02, 2019, 04:06:21 PM
It can be a caching issue as well, do you know if your host is running some cache like Varnish?
Title: Re: Topic Posting Issue
Post by: drewactual on February 02, 2019, 04:12:56 PM
i wager it's caching... I use clean talk and have never encountered this- it's virtually transparent. 

to be sure, though, you may want to log into the cleantalk control panel and make sure it's not set up with some sort of function that causes this... there are several bells whistles and toggles in that panel, so it's conceivable. 

i'd be interested in seeing the error log and see if it's catching any strange business, both on SMF and the server.
Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 02, 2019, 08:49:02 PM
It can be a caching issue as well, do you know if your host is running some cache like Varnish?

Not 100% sure I am with one.com so will contact there live chat and ask and reply here with my findings!
Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 02, 2019, 08:50:32 PM
i wager it's caching... I use clean talk and have never encountered this- it's virtually transparent. 

to be sure, though, you may want to log into the cleantalk control panel and make sure it's not set up with some sort of function that causes this... there are several bells whistles and toggles in that panel, so it's conceivable. 

i'd be interested in seeing the error log and see if it's catching any strange business, both on SMF and the server.

I have already toggled some of the settings and fully uninstalled cleantalk with no change so seems more like an issue somewhere else.

As for logs I am not sure where to look or what to look for I will see what my host says first.
Title: Re: Topic Posting Issue
Post by: drewactual on February 02, 2019, 10:32:34 PM
the logs i'm thinking of primarily are accessible from your admin panel.. go to admin>maintenance>logs>error logs
Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 02, 2019, 11:27:07 PM
So I confirmed with my hosting company that yes they do use Varnish Cache, I have added
Code: [Select]
Header add "Cache-Control" "no-cache" to my .htaccess file in the root directory of my website however after doing so I am still experiencing the same problem.

I will take a look through the Admin/Maintenance/Logs and see what I can find.
Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 02, 2019, 11:30:27 PM
Ok wow I got a lot of errors, dunno where to start...   ::)

Anyone fancy taking a look for me? 

EDITED:  Mostly errors like this 
Code: [Select]
8192: Function create_function() is deprecated
Not sure whats up  :(
Title: Re: Topic Posting Issue
Post by: Aleksi "Lex" Kilpinen on February 02, 2019, 11:39:25 PM
So I confirmed with my hosting company that yes they do use Varnish Cache
I would suggest you ask your host if they can completely disable it for you - but I'd imagine they won't.
We've seen Varnish cause some strange things before, stranger than what you are experiencing now.

EDITED:  Mostly errors like this 
Code: [Select]
8192: Function create_function() is deprecated
What PHP version are you running on?
Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 02, 2019, 11:44:22 PM
So I confirmed with my hosting company that yes they do use Varnish Cache
I would suggest you ask your host if they can completely disable it for you - but I'd imagine they won't.
We've seen Varnish cause some strange things before, stranger than what you are experiencing now.

EDITED:  Mostly errors like this 
Code: [Select]
8192: Function create_function() is deprecated
What PHP version are you running on?

I tried deleting the 33k errors then started 1 topic, checked errors and theres 126 new errors.

Im running php7.3 on web host if that helps any?
Title: Re: Topic Posting Issue
Post by: drewactual on February 02, 2019, 11:52:59 PM
that helps a lot....

can you back up to php7.0 or 7.1 (ask your host...)?  you can get by with 7.2 with a mod that's available, but 7.3 is a bridge too far.  7.1 is ready out of the box for most SMF uses- there are some mod's that won't like it, but i understand 7.1 is good for almost all. 

Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 03, 2019, 12:00:13 AM
Thanks for the info by default I have option of 7.1 7.2 and 7.3

I will backup to 7.1 and retest tomorrow as it does state it can take up to 20 minutes to take effect and I need to catch some sleep! 5am here in Scotland  ;D

Thanks again and I will reply when I have tested.
Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 03, 2019, 12:03:32 AM
that helps a lot....

can you back up to php7.0 or 7.1 (ask your host...)?  you can get by with 7.2 with a mod that's available, but 7.3 is a bridge too far.  7.1 is ready out of the box for most SMF uses- there are some mod's that won't like it, but i understand 7.1 is good for almost all.

Seems to be fixed, gave it 2 minutes after backup to 7.1 and tried 2 new topics, so far they both have shown up instantly and no errors at all so could be solved, i will restest later after some sleep and if good I will mark as solved!   Fingers Crossed!
Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 03, 2019, 08:07:10 AM
This issue now resolved, seems changing the website to run phpbb 7.1 fixed it!

Thanks to all of you who helped, very much appreciated!  :-*
Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 03, 2019, 11:32:23 AM
that helps a lot....

can you back up to php7.0 or 7.1 (ask your host...)?  you can get by with 7.2 with a mod that's available, but 7.3 is a bridge too far.  7.1 is ready out of the box for most SMF uses- there are some mod's that won't like it, but i understand 7.1 is good for almost all.

Opened this back up as still having same issue with php 7.1 however not getting the same errors, only errors i am getting now which I think are not related are...

Unable to send mail to the email address

CleanTalk: allow message for

and

CleanTalk: allow regisration for
Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 06, 2019, 07:31:33 PM
that helps a lot....

can you back up to php7.0 or 7.1 (ask your host...)?  you can get by with 7.2 with a mod that's available, but 7.3 is a bridge too far.  7.1 is ready out of the box for most SMF uses- there are some mod's that won't like it, but i understand 7.1 is good for almost all.

Opened this back up as still having same issue with php 7.1 however not getting the same errors, only errors i am getting now which I think are not related are...

Unable to send mail to the email address

CleanTalk: allow message for

and

CleanTalk: allow regisration for

So the above quote of myself has been fixed but that was not the issue, still have a delay in new topics showing, it does highlight the board to show theres a new topic but for some reason the actual topic is not visible for a minute or 2, any ideas what might cause such a delay?
Title: Re: Topic Posting Issue
Post by: Aleksi "Lex" Kilpinen on February 06, 2019, 11:23:51 PM
Caching. That is exactly what caching does, and is supposed to do.
Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 08, 2019, 03:48:29 PM
Caching. That is exactly what caching does, and is supposed to do.

Ok so is there something I can do or just leave it be with the delay? Thanks.
Title: Re: Topic Posting Issue
Post by: Aleksi "Lex" Kilpinen on February 08, 2019, 03:51:48 PM
If your host is doing some sort of caching, you can at least try disabling the cache in SMF to see if it would make a difference.
If it doesn't seem to help, all you can do is ask your host to look in to it, as the reason is most likely Varnish.
Title: Re: Topic Posting Issue
Post by: Captain Bigzy on February 08, 2019, 09:14:37 PM
Alrighty I will ask them, I already disabled Varnish via the .htaccess file

Code: [Select]
Header add "Cache-Control" "no-cache"
Not sure if thats right though, just what someone suggested I try.
Title: Re: Topic Posting Issue
Post by: drewactual on February 08, 2019, 09:35:28 PM
since you can access htaccess, check for these, and if not there, add them:

Code: [Select]

## EXPIRES CACHING ##
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/jpg "access plus 6 months"
  ExpiresByType image/jpeg "access plus 6 months"
  ExpiresByType image/gif "access plus 6 months"
  ExpiresByType image/png "access plus 6 months"
  ExpiresByType text/css "access plus 6 months"
  ExpiresByType application/javascript "access plus 6 months"
  ExpiresByType text/javascript "access plus 6 months"
  ExpiresByType text/x-javascript "access plus 6 months"
  ExpiresByType application/x-shockwave-flash "access plus 6 months"
  ExpiresByType image/ico "access plus 1 year"
  ExpiresByType image/x-icon "access plus 1 year"
  ExpiresDefault "access plus 6 months"
  ExpiresByType application/x-httpd-php A0
  ExpiresByType application/x-python-code A0
  ExpiresByType text/html A0
</IfModule>
## EXPIRES CACHING ##

and the headers as well:
Code: [Select]
<ifModule mod_headers.c>
  <filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif)$">
   Header set Cache-Control "max-age=15778800, public"
  </filesMatch>
  <filesMatch "\\.(css)$">
   Header set Cache-Control "max-age=15778800, public"
  </filesMatch>
  <filesMatch "\\.(js)$">
   Header set Cache-Control "max-age=15778800, private"
  </filesMatch>
  <filesMatch "\\.(xml|txt)$">
   Header set Cache-Control "max-age=15778800, public, must-revalidate"
  </filesMatch>
  <filesMatch "\\.(html|htm|php)$">
   Header set Cache-Control "max-age=1, private, must-revalidate"
  </filesMatch>
</ifModule>

notice that in both directives the php/html/htm is set to expiring the cache either immediately or at access +one second... If you don't have the rest of the directives, give them a shot.  you'll like what it does for you most likely.  caveat: these aren't a good idea UNLESS you rarely change/alter your files...

that 'should' take care of your problem, which is the output of php (html) is being held on to for too long... even 60 seconds can be too much for a forum if people are waiting around for a response, and not seeing one within a minute (because the cache let it live that long).