Not planned Store smilies in browser cache

grisha2217

Active member
Hi guys. I suggest store smilies in localStorage. Smilies changes very rarely, because it makes sense to cache smilies!

Realization:
  1. First loading - load smilies from server and cache it in localStorage.
  2. Next loadings - get smilies cache key from server response when editor is loaded and compare keys. If keys are indentical - load smilies from cache, if no - load from server.
 
Upvote 1
This suggestion has been closed. Votes are no longer accepted.
Browsers really already have a built-in mechanism for this -- they cache static resources without issue, you just need to send the necessary headers along with them. You can do this via things like .htaccess to set "far future expires" headers (or via whatever mechanism is appropriate for your web server). This sort of thing applies to most static files, though how you approach this will vary based off your particular needs and understanding. For example, if you want to change a smilie, you'd have to change the URL to it, similar to how we use a "cache buster" key with JS and css.php.

No need for us to implement anything along these lines in JS.
 
Browsers really already have a built-in mechanism for this -- they cache static resources without issue, you just need to send the necessary headers along with them. You can do this via things like .htaccess to set "far future expires" headers (or via whatever mechanism is appropriate for your web server). This sort of thing applies to most static files, though how you approach this will vary based off your particular needs and understanding. For example, if you want to change a smilie, you'd have to change the URL to it, similar to how we use a "cache buster" key with JS and css.php.

No need for us to implement anything along these lines in JS.
good, so why this is not implemented to xenfororo yet?
 
Setting this by default requires some understanding of the caveats (such as the inability to change things without changing the URL). If you're happy with that and understand the steps you'd need to take to make changes, then it's something we'd recommend you add.
 
Top Bottom