Monday, April 3, 2017

Caching rendered pages of database queries

Whats the best approach for caching search results on a site so that a user can still use the back button?

The results are pulled from a database query (Laravel & Eloquent) performed using a post request. These are rendered using Blade templates, but when a user clicks on a result, then clicks back I get a

Confirm Form Resubmission

This web page requires data that you entered earlier in order to be properly displayed. You can send this data again, but by doing so you will repeat any action this page previously performed.

I know if I used the url to pass the variables in the search I would be fine, but is there another way?



via Craig Ward

Advertisement