I am trying to use simplecache for Javascript. I followed the documentation and created this code.
//Register js in cache
elgg_register_simplecache_view('js/skype/skype-uri');
$url = elgg_get_simplecache_url('js', 'skype/skype-uri');
elgg_register_js('skype-uri', $url);
I created a skype-uri.php with the JS in it in /mod/skype/views/default/js/skype/
The JS file does not load. If you try to open the js file as show in the SRC of the HTML, it says
Cache error: bad request
I tried it for another plugin which did not use caching and there it worked. Do I need to change the JS itself ?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- iionly@iionly
iionly - 0 likes
- Gerard@gkanters
Gerard - 0 likes
- Juho Jaakkola@juho.jaakkola
Juho Jaakkola - 0 likes
- Juho Jaakkola@juho.jaakkola
Juho Jaakkola - 0 likes
- Gerard@gkanters
Gerard - 0 likes
You must log in to post replies.With the code you will only register the library but not yet load it. Add
elgg_load_js('skype-uri');
at an appropriate location in your code, i.e. before you refer to anything within the library.
Im sorry, I forgot to mention that. I did load the JS in the view as the first line of code.
What do you mean by this? What exactly works in another plugin and how did you make it work?
At first this sounded like "Simplecache works in a plugin that doesn't use simplecache", which doesn't make much sense. :)
Oh hey, now I got it: dash is not allowed character in the simplecache url. Allowed characters are: _a-zA-Z0-9
That's it. Thanks man