Discussion:
set_transient returns false on live server but true on local host.
Haluk Karamete
2014-01-05 15:35:56 UTC
Permalink
What would be the reason for the set_transient API to return FALSE on a
live server but TRUE on local host - that's obviously for the same code.

The only diff is live server is IIS and the local is Apache.

And how would I get to the bottom of a set_transient-returns-FALSE
situation?

I understand that the set_transient does not return an error object in the
case of something not going right.
Otto
2014-01-05 15:52:04 UTC
Permalink
If we assume that neither server has an external object cache set up,
then a return of false here most likely means that the insert or
update of the options table failed. In which case, check that the
options table doesn't need a REPAIR run on it.

-Otto
Post by Haluk Karamete
What would be the reason for the set_transient API to return FALSE on a
live server but TRUE on local host - that's obviously for the same code.
The only diff is live server is IIS and the local is Apache.
And how would I get to the bottom of a set_transient-returns-FALSE
situation?
I understand that the set_transient does not return an error object in the
case of something not going right.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Haluk Karamete
2014-01-05 17:41:54 UTC
Permalink
Otto, after your reminder about the external cachers, I found out that the
production server has total cache installed.

I tried the solution mentioned here
http://wordpress.stackexchange.com/questions/108287/trouble-with-transient-api-when-w3tc-is-activated

but no luck.

still the beautiful transient system that WordPress has for us is by passed
here... I build a plug in tapping into the core transient API's left and
right... and it works like a charm on my localhost test environment...
but these external cache systems put a bullet hole into the basics...

Any recommendations?
Post by Otto
If we assume that neither server has an external object cache set up,
then a return of false here most likely means that the insert or
update of the options table failed. In which case, check that the
options table doesn't need a REPAIR run on it.
-Otto
Post by Haluk Karamete
What would be the reason for the set_transient API to return FALSE on a
live server but TRUE on local host - that's obviously for the same code.
The only diff is live server is IIS and the local is Apache.
And how would I get to the bottom of a set_transient-returns-FALSE
situation?
I understand that the set_transient does not return an error object in
the
Post by Haluk Karamete
case of something not going right.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Otto
2014-01-05 21:53:42 UTC
Permalink
I use W3TC myself, and it works fine for me, but you do have to
configure it properly. Check the config there and make sure everything
is set right. Or, turn it off if you cannot find the config settings.

Caching isn't an end-user thing, it needs to be configured by an admin
who knows what he's doing.

-Otto
Post by Haluk Karamete
Otto, after your reminder about the external cachers, I found out that the
production server has total cache installed.
I tried the solution mentioned here
http://wordpress.stackexchange.com/questions/108287/trouble-with-transient-api-when-w3tc-is-activated
but no luck.
still the beautiful transient system that WordPress has for us is by passed
here... I build a plug in tapping into the core transient API's left and
right... and it works like a charm on my localhost test environment...
but these external cache systems put a bullet hole into the basics...
Any recommendations?
Post by Otto
If we assume that neither server has an external object cache set up,
then a return of false here most likely means that the insert or
update of the options table failed. In which case, check that the
options table doesn't need a REPAIR run on it.
-Otto
Post by Haluk Karamete
What would be the reason for the set_transient API to return FALSE on a
live server but TRUE on local host - that's obviously for the same code.
The only diff is live server is IIS and the local is Apache.
And how would I get to the bottom of a set_transient-returns-FALSE
situation?
I understand that the set_transient does not return an error object in
the
Post by Haluk Karamete
case of something not going right.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Haluk Karamete
2014-01-07 23:36:24 UTC
Permalink
Otto, it wasn't the total cache... It was a char set issue. The data I
happened to choose to store was having a char that the set_transient did
not want to deal with... it's my bad luck that my test data has a such a
junk in it.

I realized it later on that when I did an htmlspecialchar($on_that_value),
the htmlspecialchars outtputted nada, zilch!
And that explains why the set_transient was returning false.

When I stored a different data, I saw that there was nothing wrong at all.
Transients continued to work with total cache and without.

Do you guys do htmlspecialchars or anything of that sort within the
set_transient process?
could the following remedy the issue?

htmlspecialchars($problematic_val, ENT_COMPAT|ENT_SUBSTITUTE, "UTF-8")
Post by Otto
I use W3TC myself, and it works fine for me, but you do have to
configure it properly. Check the config there and make sure everything
is set right. Or, turn it off if you cannot find the config settings.
Caching isn't an end-user thing, it needs to be configured by an admin
who knows what he's doing.
-Otto
Post by Haluk Karamete
Otto, after your reminder about the external cachers, I found out that
the
Post by Haluk Karamete
production server has total cache installed.
I tried the solution mentioned here
http://wordpress.stackexchange.com/questions/108287/trouble-with-transient-api-when-w3tc-is-activated
Post by Haluk Karamete
but no luck.
still the beautiful transient system that WordPress has for us is by
passed
Post by Haluk Karamete
here... I build a plug in tapping into the core transient API's left and
right... and it works like a charm on my localhost test environment...
but these external cache systems put a bullet hole into the basics...
Any recommendations?
Post by Otto
If we assume that neither server has an external object cache set up,
then a return of false here most likely means that the insert or
update of the options table failed. In which case, check that the
options table doesn't need a REPAIR run on it.
-Otto
Post by Haluk Karamete
What would be the reason for the set_transient API to return FALSE on
a
Post by Haluk Karamete
Post by Otto
Post by Haluk Karamete
live server but TRUE on local host - that's obviously for the same
code.
Post by Haluk Karamete
Post by Otto
Post by Haluk Karamete
The only diff is live server is IIS and the local is Apache.
And how would I get to the bottom of a set_transient-returns-FALSE
situation?
I understand that the set_transient does not return an error object in
the
Post by Haluk Karamete
case of something not going right.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Loading...