View previous topic :: View next topic |
Author |
Message |
DToolan
Joined: 14 Aug 2004 Posts: 1384 Location: Dallas / Fort Worth, Texas (USA)
|
Posted: Mon Jan 02, 2006 7:26 pm Post subject: New forum doesn't deliver latest pages... |
|
|
Ever since the recent forum update, page views (clicking a link to load a page) doesn't always deliver the latest version of that page from the server if a previous version of that page resides in the user's cache.
This creates multiple problems, for instance... a user creates a post on an exsisting topic and the page reloads. He doesn't see his new post because it is a cached version. He posts again thinking his submittal didn't go through. There are many of these duplicate postings on the forum.
A user logs in and views the forum topics. He clicks on one that he's read before and decides to post a reply. He is asked to log in again because the page he just viewed came from cache and not server and it doesn't know he's already logged in.
I could go on with more irritations about this but I'll stop there. I know you might suggest changing "Internet Options / Temporary Internet Files / Settings / Check for newer versions of stored pages:", but that's not it (been there, done all that). Somewhere, in all this PHP forum setup, there must have been a new option (or changed option) for cached pages.
Perhaps adding the following header code to the server pages would help...
Code: | <meta http-equiv="Pragma" content="no-cache">
<!-- Pragma content set to no-cache tells the browser not to cache the page --> |
In the mean-time, I have to press the CTRL key (forcing a new page load) for every forum view. |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Tue Jan 03, 2006 10:20 pm Post subject: |
|
|
Hi,
I was also tired to click on the Internet Explorer refresh button
so I wrote a small VB6 program to take care of the problem.
The program opens and controls a Internet Explorer window
and does the refresh for me. When the URL changes, a refresh is
automatically performed. While posting and while in PM the
automatic refresh is disabled. The program Form caption will show
a counter with the number of refreshes performed. If you have the
Windows Taskbar always visible you will see the counter even when
the program is minimized or is behind the Internet Explorer browser
window.
How to compile with VB 6.0:
Open a new Standard EXE project and add two buttons on Form1.
Add a reference to "Microsoft Internet Controls" from the VB6 IDE.
To do that, go to menu Project\References and select
"Microsoft Internet Controls" from the list of references.
The whole code (the code below) goes in Form1.
* * *
Only a Internet Explorer window opened with this program will
automatically refresh.
Best regards,
Luciano
The VB6 code:
Code: |
'================================================================
'
'''Form1 general declaration
Option Explicit
Dim close_ie_flag As Boolean
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
'
'================================================================
Private Sub Command1_Click ()
Dim IE As InternetExplorer
Set IE = New InternetExplorer ''''Create new instance of the object
'''The InternetExplorer object lets you control a remote instance of IE.
'''To use it, add a reference to "Microsoft Internet Controls" from the VB6 IDE.
'''To do that, go to menu Project\References and select it from the list.
Dim ie_current_url As String
Dim ie_last_known_url As String
Dim refresh_counter As Long
Dim refresh_allowed As Boolean
On Error GoTo UnexpectedError
close_ie_flag = False
Command2.Enabled = True
Command1.Enabled = False
refresh_counter = 0
IE.Visible = True
IE.Navigate "http://www.mcselec.com/index2.php?option=com_forum&Itemid=59"
ie_last_known_url = IE.LocationURL '''Get the current URL
Do
ie_current_url = IE.LocationURL '''Get the current URL
If ie_current_url <> ie_last_known_url Then '''The URL has changed?
refresh_allowed = True
If InStr(1, ie_current_url, "posting", 1) Then '''no refresh while posting
refresh_allowed = False
Me.Caption = "P Autorefresh " '''P like POSTING
End If
If InStr(1, ie_current_url, "page=privmsg", 1) Then '''no refresh while using PM
refresh_allowed = False
Me.Caption = "PM Autorefresh " '''PM like PRIVATE MESSAGE
End If
If InStr(1, ie_current_url, "page=search", 1) Then '''no refresh while searching
refresh_allowed = False
Me.Caption = "S Autorefresh " '''S like SEARCH
End If
If refresh_allowed = True Then
IE.Refresh '''refresh our IE browser window
ie_last_known_url = ie_current_url
refresh_counter = refresh_counter + 1
Me.Caption = refresh_counter & " Autorefresh "
'''The form caption will show a counter with the number of refresh performed.
'''If you have the Windows Taskbar always visible, you will see the counter
'''even when this program is minimized or is behind the IE browser window.
End If
End If
Sleep 100 '''100 ms, Windows API call
DoEvents
Loop Until close_ie_flag = True '''See Command2_Click()
IE.Quit '''Close the browser
Set IE = Nothing '''Clean up
Command1.Enabled = True
Command2.Enabled = False
Me.Caption = "Autorefresh"
Exit Sub
UnexpectedError :
'''You get an error if you close the IE browser instance from its GUI
'''The program can take up to 3 seconds to recover from this error.
Set IE = Nothing '''Clean up
Command2.Enabled = False
Command1.Enabled = True
Me.Caption = "Autorefresh"
End Sub
'================================================================
Private Sub Command2_Click ()
close_ie_flag = True '''Terminate the loop in Command1_Click()
End Sub
'================================================================
Private Sub Form_Load ()
Me.Caption = "Autorefresh"
Command1.Enabled = True
Command1.Caption = "Open forum www.mcselec.com"
Command2.Caption = "Close forum www.mcselec.com"
Command2.Enabled = False
End Sub
'================================================================
|
Last edited by Luciano on Thu Jan 05, 2006 9:08 am; edited 2 times in total |
|
Back to top |
|
|
DToolan
Joined: 14 Aug 2004 Posts: 1384 Location: Dallas / Fort Worth, Texas (USA)
|
Posted: Tue Jan 03, 2006 11:26 pm Post subject: |
|
|
Ummmm... jeez, you went through a lot of effort to work around something they should be able to fix in their PHPBB setup?
I did a search of the PHPBB forum and found many similar postings. Most were answered with a link to a PHP mod script to fix "auto cookies" on the PHP server.
Here is a link to one similar post... New posts not showing?
I would ask if the forum caretakers have tried this "PHP Auto Cookies MOD" and if not, to do so and then we can all do the "cookies and cache" dance. |
|
Back to top |
|
|
tomi
Joined: 22 Feb 2005 Posts: 155 Location: Universe
|
|
Back to top |
|
|
DToolan
Joined: 14 Aug 2004 Posts: 1384 Location: Dallas / Fort Worth, Texas (USA)
|
Posted: Thu Jan 05, 2006 4:05 am Post subject: |
|
|
Quote: | Cache is enabled because some users has problem with expired POST data after using search function. |
I have a feeling they didn't intend to trade the cure of one problem for the creation of 6 different ones. |
|
Back to top |
|
|
tomi
Joined: 22 Feb 2005 Posts: 155 Location: Universe
|
Posted: Thu Jan 05, 2006 12:10 pm Post subject: |
|
|
Hi,
I change lifetime of private cache (browser's) used to caching POST data to 90sec. This I hope can help. If problem still persist, please post message here and I can try do another solution. _________________ Best regards,
/Tomi |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Fri Jan 06, 2006 1:03 pm Post subject: |
|
|
Hi Tomi,
Seems to work. I will post again if I see something.
Thank you.
Best regards,
Luciano |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Sun Aug 06, 2006 11:42 am Post subject: |
|
|
Hi Tomi,
Please fix this problem.
Problem: Forum doesn't deliver latest pages.
Thank you.
Best regards,
Luciano
(One of the side effects of the problem. Click to enlarge).
|
|
Back to top |
|
|
Sergei
Joined: 30 Dec 2005 Posts: 58
|
Posted: Sun Aug 06, 2006 3:30 pm Post subject: |
|
|
Wrong approach to fix the expired problem tho.
phpBB should always post data immediatly.
caching could work but if the cache information is garbled then
you may expect duplicate/triple and so on posts.
Is this board running on mySQL or SQL or postgres?
In case of mySQL or SQL, do know that phpbb does not store it's data on the most effecient way so the database can be optimized. SQL makes it possible.
Session managment is the second cullprit if the server is getting mixed up with user data. |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Wed Aug 23, 2006 8:56 pm Post subject: |
|
|
Hi,
Working OK now.
Thank you everybody!
Luciano |
|
Back to top |
|
|
|