View Full Version : Ajax Pagination Script - need to refresh for newest content

08-06-2014, 02:15 AM
1) Script Title: :: Ajax Pagination script v1.2.2

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxpaginate/index.htm

3) Describe problem: This script works well for me, I'm able to view six different pages on my website that are defined with this script. The pages are loaded as external files. Each page is dynamic content which means that the files it loads, are subject to change at any time.

If I visit my website without being logged in, the first pagination page might look like this:

1) Bird
2) Bear
3) Horse
4) Cow

Now once I proceed to log myself in and have additional security applied to my account (my site uses access levels), the dynamic content changes because it shows me additional information (animals in this example) that is not shown to the public (people who are not logged on).

When I am logged on I should be seeing:

1) Bird
2) Zebra
3) Bear
4) Dolphin
5) Horse
6) Cow

because Zebra and Dolphin are animals I have access to now. However I do not see the results above, I see the results from when I was not logged on (the 4 animals instead of 6). I have to press F5 to refresh the page and then I can see the proper content. This is a caching issue and I've experienced it before with Ajax loads. I was able to correct it before by changing the html form from a GET to a POST but this was an entirely different script.

Aside from having my members refresh to see new changes (which defeats the dynamic content idea) what can I do? I have tried using meta tags to tell the browser not to cache, but to no avail.

This script allows for the refresh() command but I'm not certain if this helps me in any way.

Is there a way to have the pagination load the content without it being cached? It is loading the old data rather than the new data. Thank you.

08-06-2014, 06:19 PM
First thing I'd suggest trying is to ensure the page itself isn't cached. View the suggestions listed here: http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers If that doesn't work then the script's refresh() method may be helpful, though first and foremost you should ensure the page itself isn't cached, otherwise it's meaningless.